Skip to content

Commit 7539641

Browse files
committed
ruff
1 parent e5c968e commit 7539641

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.config/ruff.toml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Python 2.7 and 3.3+ compatibility requirements (using py37 as minimum ruff supports)
2+
target-version = "py37"
3+
4+
# Define Python 2.7 builtins that don't exist in Python 3
5+
builtins = ["unicode"]
6+
7+
line-length = 200
8+
9+
[lint]
10+
# Enable most rules
11+
select = [
12+
"E", # pycodestyle errors
13+
"W", # pycodestyle warnings
14+
"F", # Pyflakes
15+
"I", # isort
16+
]
17+
18+
ignore = [
19+
"I001", # Import block unsorted
20+
"W292", # No newline at end of file
21+
"W293", # Blank line contains whitespace
22+
]
23+
24+
# Per-file ignores for specific compatibility needs
25+
[lint.per-file-ignores]
26+
# AST compatibility module needs star imports for Python version compatibility
27+
"src/python_minifier/ast_compat.py" = ["F403", "F405"]
28+
29+
# __init__.py files intentionally re-export for public API
30+
"*/__init__.py" = ["F401"]
31+
32+
# Type comparisons needed for Python 2.7 compatibility in specific files
33+
"src/python_minifier/ast_compare.py" = ["E721"]
34+
"src/python_minifier/rename/rename_literals.py" = ["E721"]
35+
"src/python_minifier/transforms/constant_folding.py" = ["E721"]
36+
37+
# Compatibility imports in utility modules
38+
"src/python_minifier/rename/util.py" = ["F401"]
39+
40+
[lint.isort]
41+
force-single-line = false
42+
known-first-party = ["python_minifier"]

0 commit comments

Comments
 (0)