Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some ARG002 per file ignores #11382

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion audio_filters/show_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


class FilterType(Protocol):
def process(self, sample: float) -> float:
def process(self, sample: float) -> float: # noqa: ARG002
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would happen if we delete the unused variables?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class is used as interface, so I made this method absctract. Now there are no problems with unused method argument in this place

"""
Calculate y[n]

Expand Down
2 changes: 1 addition & 1 deletion data_structures/hashing/hash_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def _set_value(self, key, data):
self.values[key] = data
self._keys[key] = data

def _collision_resolution(self, key, data=None):
def _collision_resolution(self, key, data=None): # noqa: ARG002
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Done. noqa left in data_structures/hashing/quadratic_probing.py where this method is overridden

"""
This method is a type of open addressing which is used for handling collision.

Expand Down
2 changes: 1 addition & 1 deletion data_structures/hashing/quadratic_probing.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class QuadraticProbing(HashTable):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)

def _collision_resolution(self, key, data=None):
def _collision_resolution(self, key, data=None): # noqa: ARG002
"""
Quadratic probing is an open addressing scheme used for resolving
collisions in hash table.
Expand Down
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,8 @@ max-complexity = 17 # default: 10

[tool.ruff.lint.per-file-ignores]
"arithmetic_analysis/newton_raphson.py" = ["PGH001"]
"audio_filters/show_response.py" = ["ARG002"]
"data_structures/binary_tree/binary_search_tree_recursive.py" = ["BLE001"]
"data_structures/binary_tree/treap.py" = ["SIM114"]
"data_structures/hashing/hash_table.py" = ["ARG002"]
"data_structures/hashing/quadratic_probing.py" = ["ARG002"]
"data_structures/hashing/tests/test_hash_map.py" = ["BLE001"]
"data_structures/heap/max_heap.py" = ["SIM114"]
"graphs/minimum_spanning_tree_prims.py" = ["SIM114"]
Expand Down