Skip to content

Commit 73428e4

Browse files
authored
Merge pull request #6560 from opsmill/pog-ruf036
Linting: RUF036 `None` not at the end of the type annotation
2 parents 8001fb5 + ebc225b commit 73428e4

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
@@ -547,7 +547,6 @@ ignore = [
547547
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
548548
"RUF015", # Prefer `next(...)` over single element slice
549549
"RUF029", # Function is declared `async`, but doesn't `await` or use `async` features.
550-
"RUF036", # `None` not at the end of the type annotation.
551550
"RUF043", # Pattern passed to `match=` contains metacharacters but is neither escaped nor raw
552551
"RUF052", # Local dummy variable `_meta` is accessed
553552
"RUF100", # [*] Unused `noqa` directive (non-enabled: `INP001`)

0 commit comments

Comments
 (0)