Skip to content

Commit

Permalink
Use cls as first classmethod argument (Fix: N804) (#939)
Browse files Browse the repository at this point in the history
  • Loading branch information
ogenstad authored Jun 28, 2024
1 parent ecef440 commit 90338cf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 3 additions & 3 deletions nornir/core/inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def __init__(
)

@classmethod
def schema(self) -> Dict[str, Any]:
def schema(cls) -> Dict[str, Any]:
return {
"extras": {"$key": "$value"},
**super().schema(),
Expand Down Expand Up @@ -138,7 +138,7 @@ def __init__(
)

@classmethod
def schema(self) -> Dict[str, Any]:
def schema(cls) -> Dict[str, Any]:
return {
"groups": ["$group_name"],
"data": {"$key": "$value"},
Expand Down Expand Up @@ -218,7 +218,7 @@ def __init__(
)

@classmethod
def schema(self) -> Dict[str, Any]:
def schema(cls) -> Dict[str, Any]:
return {
"data": {"$key": "$value"},
"connection_options": {"$connection_type": ConnectionOptions.schema()},
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ ignore = [
"FBT002", # Boolean default positional argument in function definition
"FURB101", # `open` and `read` should be replaced by `Path(filename).read_text()`
"INP001", # File is part of an implicit namespace package. Add an `__init__.py`.
"N804", # First argument of a class method should be named `cls`
"PERF203", # `try`-`except` within a loop incurs performance overhead
"PGH004", # Use specific rule codes when using `noqa`
"PIE800", # Unnecessary spread `**`
Expand Down

0 comments on commit 90338cf

Please sign in to comment.