Skip to content

Commit 7c983a3

Browse files
committed
Enable ruff A rule for builtin shadowing detection
- Globally ignore A002 since id/type are API field names - Rename shadowing local variable in test (input -> data)
1 parent a35befd commit 7c983a3

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)