Skip to content

Commit 16b48c7

Browse files
committed
Enable ruff A rule for builtin shadowing detection
Add flake8-builtins rule set with A002 globally ignored since model parameters (id, type) intentionally match Overkiz API field names. Rename shadowed variable in test_obfuscate.
1 parent 825b6b7 commit 16b48c7

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

pyproject.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,13 @@ select = [
7373
"C4",
7474
# pep8-naming
7575
"N",
76+
# flake8-builtins
77+
"A",
78+
]
79+
ignore = [
80+
"E501", # Line too long
81+
"A002", # Shadowing builtins (id, type) is intentional for API field names
7682
]
77-
ignore = ["E501"] # Line too long
7883

7984
[tool.ruff.lint.per-file-ignores]
8085
"tests/**" = ["S101"] # Allow assert in tests

tests/test_obfuscate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class TestObfucscateSensitive:
2828

2929
def test_obfuscate_list_with_none(self):
3030
"""Ensure lists containing None values are handled without modification."""
31-
input = {
31+
data = {
3232
"d": [
3333
0,
3434
0,
@@ -56,4 +56,4 @@ def test_obfuscate_list_with_none(self):
5656
None,
5757
]
5858
}
59-
assert obfuscate_sensitive_data(input) == input
59+
assert obfuscate_sensitive_data(data) == data

0 commit comments

Comments
 (0)