Skip to content

Commit 6511168

Browse files
authored
Enable ruff A rule (builtin shadowing detection) (#2005)
## Summary - Add flake8-builtins rule set with A002 globally ignored (model parameters like `id`, `type` intentionally match Overkiz API field names) - Rename shadowed `input` variable in `test_obfuscate.py` ## Test plan - [x] `ruff check .` passes - [x] `pytest` — 280 tests pass
1 parent a35befd commit 6511168

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,13 @@ select = [
120120
"PYI",
121121
# flake8-pathlib
122122
"PTH",
123+
# flake8-builtins
124+
"A",
123125
]
124126
ignore = [
125127
"E501", # Line too long
126128
"TRY003", # Long exception messages are acceptable for domain-specific errors
129+
"A002", # Shadowing builtins (id, type) is intentional for API field names
127130
]
128131

129132
[tool.ruff.lint.per-file-ignores]

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)