diff --git a/infrahub_sdk/client.py b/infrahub_sdk/client.py index 3b9004c1..4d7cf4ff 100644 --- a/infrahub_sdk/client.py +++ b/infrahub_sdk/client.py @@ -58,8 +58,6 @@ from types import TracebackType -# pylint: disable=redefined-builtin disable=too-many-lines - SchemaType = TypeVar("SchemaType", bound=CoreNode) SchemaTypeSync = TypeVar("SchemaTypeSync", bound=CoreNodeSync) @@ -711,7 +709,7 @@ async def filters( fragment=fragment, prefetch_relationships=prefetch_relationships, partial_match=partial_match, - # property=property, + property=property, ) query = Query(query=query_data) response = await self.execute_graphql( @@ -1147,7 +1145,7 @@ async def allocate_next_ip_address( async def allocate_next_ip_address( self, resource_pool: CoreNode, - kind: type[SchemaType] | None = None, # pylint: disable=unused-argument + kind: type[SchemaType] | None = None, # noqa: ARG002 identifier: str | None = None, prefix_length: int | None = None, address_type: str | None = None, @@ -1297,7 +1295,7 @@ async def allocate_next_ip_prefix( async def allocate_next_ip_prefix( self, resource_pool: CoreNode, - kind: type[SchemaType] | None = None, # pylint: disable=unused-argument + kind: type[SchemaType] | None = None, # noqa: ARG002 identifier: str | None = None, prefix_length: int | None = None, member_type: str | None = None, @@ -2181,7 +2179,7 @@ def allocate_next_ip_address( def allocate_next_ip_address( self, resource_pool: CoreNodeSync, - kind: type[SchemaTypeSync] | None = None, # pylint: disable=unused-argument + kind: type[SchemaTypeSync] | None = None, # noqa: ARG002 identifier: str | None = None, prefix_length: int | None = None, address_type: str | None = None, @@ -2327,7 +2325,7 @@ def allocate_next_ip_prefix( def allocate_next_ip_prefix( self, resource_pool: CoreNodeSync, - kind: type[SchemaTypeSync] | None = None, # pylint: disable=unused-argument + kind: type[SchemaTypeSync] | None = None, # noqa: ARG002 identifier: str | None = None, prefix_length: int | None = None, member_type: str | None = None, diff --git a/infrahub_sdk/ctl/branch.py b/infrahub_sdk/ctl/branch.py index eba38419..f77aa073 100644 --- a/infrahub_sdk/ctl/branch.py +++ b/infrahub_sdk/ctl/branch.py @@ -83,7 +83,7 @@ async def create( sync_with_git: bool = typer.Option( False, help="Extend the branch to Git and have Infrahub create the branch in connected repositories." ), - isolated: bool = typer.Option(True, hidden=True, help="Set the branch to isolated mode (deprecated)"), # pylint: disable=unused-argument + isolated: bool = typer.Option(True, hidden=True, help="Set the branch to isolated mode (deprecated)"), # noqa: ARG001 _: str = CONFIG_PARAM, ) -> None: """Create a new branch.""" diff --git a/infrahub_sdk/ctl/cli_commands.py b/infrahub_sdk/ctl/cli_commands.py index c0eecf79..2471f728 100644 --- a/infrahub_sdk/ctl/cli_commands.py +++ b/infrahub_sdk/ctl/cli_commands.py @@ -308,7 +308,7 @@ def transform( None, help="Variables to pass along with the query. Format key=value key=value." ), branch: str = typer.Option(None, help="Branch on which to run the transformation"), - debug: bool = False, + debug: bool = False, # noqa: ARG001 _: str = CONFIG_PARAM, list_available: bool = typer.Option(False, "--list", help="Show available transforms"), out: str = typer.Option(None, help="Path to a file to save the result."), diff --git a/infrahub_sdk/ctl/generator.py b/infrahub_sdk/ctl/generator.py index ea895ef0..8087e403 100644 --- a/infrahub_sdk/ctl/generator.py +++ b/infrahub_sdk/ctl/generator.py @@ -19,12 +19,12 @@ async def run( generator_name: str, - path: str, - debug: bool, + path: str, # noqa: ARG001 + debug: bool, # noqa: ARG001 list_available: bool, branch: str | None = None, variables: list[str] | None = None, -) -> None: # pylint: disable=unused-argument +) -> None: repository_config = get_repository_config(Path(config.INFRAHUB_REPO_CONFIG_FILE)) if list_available or not generator_name: diff --git a/infrahub_sdk/playback.py b/infrahub_sdk/playback.py index 63503704..0ec72e8c 100644 --- a/infrahub_sdk/playback.py +++ b/infrahub_sdk/playback.py @@ -44,7 +44,7 @@ def _read_request( url: str, method: HTTPMethod, headers: dict[str, Any], - timeout: int, # pylint: disable=unused-argument + timeout: int, # noqa: ARG002 payload: dict | None = None, ) -> httpx.Response: content: bytes | None = None diff --git a/infrahub_sdk/pytest_plugin/items/base.py b/infrahub_sdk/pytest_plugin/items/base.py index 0847f41e..35eca9a8 100644 --- a/infrahub_sdk/pytest_plugin/items/base.py +++ b/infrahub_sdk/pytest_plugin/items/base.py @@ -67,7 +67,7 @@ def get_result_differences(self, computed: Any) -> str | None: def runtest(self) -> None: """Run the test logic.""" - def repr_failure(self, excinfo: pytest.ExceptionInfo, style: str | None = None) -> str: + def repr_failure(self, excinfo: pytest.ExceptionInfo, style: str | None = None) -> str: # noqa: ARG002 if isinstance(excinfo.value, InvalidGitRepositoryError): return f"Invalid Git repository at {excinfo.value}" diff --git a/infrahub_sdk/spec/object.py b/infrahub_sdk/spec/object.py index dddb16db..1445a5eb 100644 --- a/infrahub_sdk/spec/object.py +++ b/infrahub_sdk/spec/object.py @@ -16,7 +16,7 @@ class InfrahubObjectFileData(BaseModel): data: list[dict[str, Any]] = Field(default_factory=list) @classmethod - def enrich_node(cls, data: dict, context: dict) -> dict: + def enrich_node(cls, data: dict, context: dict) -> dict: # noqa: ARG003 return data @classmethod diff --git a/pyproject.toml b/pyproject.toml index 5f70c19f..a117b7c0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -116,6 +116,7 @@ no-docstring-rgx = "^(_|test_)" # Pylint and Black disagree about how to format multi-line arrays; Black wins. # Rules already covered by RUFF # - too-many-statements +# - unused-argument disable = """, line-too-long, missing-module-docstring, @@ -135,6 +136,7 @@ disable = """, import-self, wrong-import-order, multiple-statements, + unused-argument, """ [tool.pylint.miscellaneous] @@ -223,7 +225,6 @@ ignore = [ ################################################################################################## # Rules below needs to be Investigated # ################################################################################################## - "ARG", # flake8-unused-arguments "PT", # flake8-pytest-style "PGH", # pygrep-hooks "ERA", # eradicate commented-out code @@ -332,6 +333,8 @@ max-complexity = 17 "S101", # Use of assert detected "S105", # Possible hardcoded password assigned to variable "S106", # Possible hardcoded password assigned to argument + "ARG001", # Unused function argument + "ARG002", # Unused method argument ################################################################################################## # Review and change the below later #