Skip to content

Commit a2957df

Browse files
committed
Active rule ARG in ruff
1 parent 322a0d1 commit a2957df

File tree

8 files changed

+17
-16
lines changed

8 files changed

+17
-16
lines changed

infrahub_sdk/client.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@
5858
from types import TracebackType
5959

6060

61-
# pylint: disable=redefined-builtin disable=too-many-lines
62-
6361
SchemaType = TypeVar("SchemaType", bound=CoreNode)
6462
SchemaTypeSync = TypeVar("SchemaTypeSync", bound=CoreNodeSync)
6563

@@ -711,7 +709,7 @@ async def filters(
711709
fragment=fragment,
712710
prefetch_relationships=prefetch_relationships,
713711
partial_match=partial_match,
714-
# property=property,
712+
property=property,
715713
)
716714
query = Query(query=query_data)
717715
response = await self.execute_graphql(
@@ -1147,7 +1145,7 @@ async def allocate_next_ip_address(
11471145
async def allocate_next_ip_address(
11481146
self,
11491147
resource_pool: CoreNode,
1150-
kind: type[SchemaType] | None = None, # pylint: disable=unused-argument
1148+
kind: type[SchemaType] | None = None, # noqa: ARG002
11511149
identifier: str | None = None,
11521150
prefix_length: int | None = None,
11531151
address_type: str | None = None,
@@ -1297,7 +1295,7 @@ async def allocate_next_ip_prefix(
12971295
async def allocate_next_ip_prefix(
12981296
self,
12991297
resource_pool: CoreNode,
1300-
kind: type[SchemaType] | None = None, # pylint: disable=unused-argument
1298+
kind: type[SchemaType] | None = None, # noqa: ARG002
13011299
identifier: str | None = None,
13021300
prefix_length: int | None = None,
13031301
member_type: str | None = None,
@@ -2181,7 +2179,7 @@ def allocate_next_ip_address(
21812179
def allocate_next_ip_address(
21822180
self,
21832181
resource_pool: CoreNodeSync,
2184-
kind: type[SchemaTypeSync] | None = None, # pylint: disable=unused-argument
2182+
kind: type[SchemaTypeSync] | None = None, # noqa: ARG002
21852183
identifier: str | None = None,
21862184
prefix_length: int | None = None,
21872185
address_type: str | None = None,
@@ -2327,7 +2325,7 @@ def allocate_next_ip_prefix(
23272325
def allocate_next_ip_prefix(
23282326
self,
23292327
resource_pool: CoreNodeSync,
2330-
kind: type[SchemaTypeSync] | None = None, # pylint: disable=unused-argument
2328+
kind: type[SchemaTypeSync] | None = None, # noqa: ARG002
23312329
identifier: str | None = None,
23322330
prefix_length: int | None = None,
23332331
member_type: str | None = None,

infrahub_sdk/ctl/branch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ async def create(
8383
sync_with_git: bool = typer.Option(
8484
False, help="Extend the branch to Git and have Infrahub create the branch in connected repositories."
8585
),
86-
isolated: bool = typer.Option(True, hidden=True, help="Set the branch to isolated mode (deprecated)"), # pylint: disable=unused-argument
86+
isolated: bool = typer.Option(True, hidden=True, help="Set the branch to isolated mode (deprecated)"), # noqa: ARG001
8787
_: str = CONFIG_PARAM,
8888
) -> None:
8989
"""Create a new branch."""

infrahub_sdk/ctl/cli_commands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ def transform(
308308
None, help="Variables to pass along with the query. Format key=value key=value."
309309
),
310310
branch: str = typer.Option(None, help="Branch on which to run the transformation"),
311-
debug: bool = False,
311+
debug: bool = False, # noqa: ARG001
312312
_: str = CONFIG_PARAM,
313313
list_available: bool = typer.Option(False, "--list", help="Show available transforms"),
314314
out: str = typer.Option(None, help="Path to a file to save the result."),

infrahub_sdk/ctl/generator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919

2020
async def run(
2121
generator_name: str,
22-
path: str,
23-
debug: bool,
22+
path: str, # noqa: ARG001
23+
debug: bool, # noqa: ARG001
2424
list_available: bool,
2525
branch: str | None = None,
2626
variables: list[str] | None = None,
27-
) -> None: # pylint: disable=unused-argument
27+
) -> None:
2828
repository_config = get_repository_config(Path(config.INFRAHUB_REPO_CONFIG_FILE))
2929

3030
if list_available or not generator_name:

infrahub_sdk/playback.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def _read_request(
4444
url: str,
4545
method: HTTPMethod,
4646
headers: dict[str, Any],
47-
timeout: int, # pylint: disable=unused-argument
47+
timeout: int, # noqa: ARG002
4848
payload: dict | None = None,
4949
) -> httpx.Response:
5050
content: bytes | None = None

infrahub_sdk/pytest_plugin/items/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def get_result_differences(self, computed: Any) -> str | None:
6767
def runtest(self) -> None:
6868
"""Run the test logic."""
6969

70-
def repr_failure(self, excinfo: pytest.ExceptionInfo, style: str | None = None) -> str:
70+
def repr_failure(self, excinfo: pytest.ExceptionInfo, style: str | None = None) -> str: # noqa: ARG002
7171
if isinstance(excinfo.value, InvalidGitRepositoryError):
7272
return f"Invalid Git repository at {excinfo.value}"
7373

infrahub_sdk/spec/object.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class InfrahubObjectFileData(BaseModel):
1616
data: list[dict[str, Any]] = Field(default_factory=list)
1717

1818
@classmethod
19-
def enrich_node(cls, data: dict, context: dict) -> dict:
19+
def enrich_node(cls, data: dict, context: dict) -> dict: # noqa: ARG003
2020
return data
2121

2222
@classmethod

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ no-docstring-rgx = "^(_|test_)"
116116
# Pylint and Black disagree about how to format multi-line arrays; Black wins.
117117
# Rules already covered by RUFF
118118
# - too-many-statements
119+
# - unused-argument
119120
disable = """,
120121
line-too-long,
121122
missing-module-docstring,
@@ -135,6 +136,7 @@ disable = """,
135136
import-self,
136137
wrong-import-order,
137138
multiple-statements,
139+
unused-argument,
138140
"""
139141

140142
[tool.pylint.miscellaneous]
@@ -223,7 +225,6 @@ ignore = [
223225
##################################################################################################
224226
# Rules below needs to be Investigated #
225227
##################################################################################################
226-
"ARG", # flake8-unused-arguments
227228
"PT", # flake8-pytest-style
228229
"PGH", # pygrep-hooks
229230
"ERA", # eradicate commented-out code
@@ -332,6 +333,8 @@ max-complexity = 17
332333
"S101", # Use of assert detected
333334
"S105", # Possible hardcoded password assigned to variable
334335
"S106", # Possible hardcoded password assigned to argument
336+
"ARG001", # Unused function argument
337+
"ARG002", # Unused method argument
335338

336339
##################################################################################################
337340
# Review and change the below later #

0 commit comments

Comments
 (0)