Skip to content

Commit

Permalink
chore(style): Use set for set inclusion condition
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Sep 27, 2024
1 parent a010951 commit 77b81e8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions jscc/testing/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def block(path, data, pointer):
if not re.search(r'^[a-z][A-Za-z]+$', key) and key not in property_exceptions:
errors += 1
warn(f"{path}: {pointer}/{key} field isn't lowerCamelCase ASCII letters", LetterCaseWarning)
elif parent in ('definitions', '$defs'):
elif parent in {'definitions', '$defs'}:
for key in data:
if not re.search(r'^[A-Z][A-Za-z]+$', key) and key not in definition_exceptions:
errors += 1
Expand Down Expand Up @@ -366,7 +366,7 @@ def validate_null_type(path, data, pointer='', *, no_null=False, expect_null=Tru
required = data.get('required', [])

for key, value in data.items():
if key in ('properties', 'definitions', '$defs'):
if key in {'properties', 'definitions', '$defs'}:
for k, v in data[key].items():
expect_null = key == 'properties' and k not in required
errors += validate_null_type(path, v, pointer=f'{pointer}/{key}/{k}', **kwargs, no_null=no_null,
Expand Down Expand Up @@ -544,7 +544,7 @@ def block(path, data, pointer):

if (
pointer
and grandparent not in ('definitions', '$defs')
and grandparent not in {'definitions', '$defs'}
and 'properties' in data
and pointer not in allow_deep
):
Expand Down

0 comments on commit 77b81e8

Please sign in to comment.