Skip to content

Commit

Permalink
diff_yaml.py: unify function name style (#31201)
Browse files Browse the repository at this point in the history
According to PEP-8 recommended style is snake_case. Hence, update the
name of byResourceName function to also use the same style
  • Loading branch information
Ruslan Mstoi authored Mar 3, 2021
1 parent 6107d13 commit 848340f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bin/diff_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# returns fully qualified resource name of the k8s resource


def byResourceName(res):
def by_resource_name(res):
if res is None:
return ""

Expand Down Expand Up @@ -118,8 +118,8 @@ def compare(args):
j0 = normalize(list(yaml.safe_load_all(open(args.orig))), args)
j1 = normalize(list(yaml.safe_load_all(open(args.new))), args)

q0 = {byResourceName(res): res for res in j0 if res is not None}
q1 = {byResourceName(res): res for res in j1 if res is not None}
q0 = {by_resource_name(res): res for res in j0 if res is not None}
q1 = {by_resource_name(res): res for res in j1 if res is not None}

added, removed, common = keydiff(q0.keys(), q1.keys())

Expand Down

0 comments on commit 848340f

Please sign in to comment.