From ed5d47d3bb64c32ecacaa5898d7d394ee733e6f9 Mon Sep 17 00:00:00 2001 From: Patrick Ogenstad Date: Fri, 28 Jun 2024 09:08:26 +0200 Subject: [PATCH] Use cls as first classmethod argument (Fix: N804) --- nornir/core/inventory.py | 6 +++--- pyproject.toml | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/nornir/core/inventory.py b/nornir/core/inventory.py index 524e7b35..73ab7485 100644 --- a/nornir/core/inventory.py +++ b/nornir/core/inventory.py @@ -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(), @@ -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"}, @@ -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()}, diff --git a/pyproject.toml b/pyproject.toml index 52b3cdb9..c4f6f775 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 `**`