Skip to content

Commit ebc225b

Browse files
committed
Linting: RUF036 None not at the end of the type annotation
1 parent 82d51f5 commit ebc225b

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

backend/infrahub/core/schema/basenode_schema.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ def generate_fields_for_display_label(self) -> dict | None:
386386
if not self.display_labels:
387387
return None
388388

389-
fields: dict[str, str | None | dict[str, None]] = {}
389+
fields: dict[str, str | dict[str, None] | None] = {}
390390
for item in self.display_labels:
391391
fields.update(self.convert_path_to_graphql_fields(path=item))
392392
return fields
@@ -401,7 +401,7 @@ def generate_fields_for_hfid(self) -> dict | None:
401401
if not self.human_friendly_id:
402402
return None
403403

404-
fields: dict[str, str | None | dict[str, None]] = {}
404+
fields: dict[str, str | dict[str, None] | None] = {}
405405
for item in self.human_friendly_id:
406406
fields.update(self.convert_path_to_graphql_fields(path=item))
407407
return fields

backend/infrahub/core/schema/schema_branch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ def generate_fields_for_display_label(self, name: str) -> dict | None:
453453
if isinstance(node, NodeSchema | ProfileSchema | TemplateSchema):
454454
return node.generate_fields_for_display_label()
455455

456-
fields: dict[str, str | None | dict[str, None]] = {}
456+
fields: dict[str, str | dict[str, None] | None] = {}
457457
if isinstance(node, GenericSchema):
458458
for child_node_name in node.used_by:
459459
child_node = self.get(name=child_node_name, duplicate=False)

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,6 @@ ignore = [
548548
"RUF015", # Prefer `next(...)` over single element slice
549549
"RUF021", # Parenthesize `a and b` expressions when chaining `and` and `or` together, to make the precedence clear
550550
"RUF029", # Function is declared `async`, but doesn't `await` or use `async` features.
551-
"RUF036", # `None` not at the end of the type annotation.
552551
"RUF043", # Pattern passed to `match=` contains metacharacters but is neither escaped nor raw
553552
"RUF052", # Local dummy variable `_meta` is accessed
554553
"RUF100", # [*] Unused `noqa` directive (non-enabled: `INP001`)

0 commit comments

Comments
 (0)