-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpyproject.toml
More file actions
55 lines (49 loc) · 1.95 KB
/
Copy pathpyproject.toml
File metadata and controls
55 lines (49 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
[tool.ruff]
# Match Black's default; 100 is also a popular modern choice — pick one and commit to it.
line-length = 100
indent-width = 4
# Set this to YOUR project's minimum Python version. Drives version-specific rules/fixes.
target-version = "py312"
# Directories Ruff should never touch (these are sensible defaults).
extend-exclude = [
".venv",
"build",
"dist",
"__pycache__",
]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # Pyflakes (unused imports/vars, undefined names)
"I", # isort (import sorting — replaces your old isort)
"N", # pep8-naming
"UP", # pyupgrade (modernize syntax for your target-version)
"B", # flake8-bugbear (likely-bug patterns)
"C4", # flake8-comprehensions
"SIM", # flake8-simplify
"RET", # flake8-return
"PTH", # prefer pathlib over os.path
"TID", # tidy imports
"TC", # type-checking import hygiene (TYPE_CHECKING blocks)
"ICN", # import naming conventions (np, pd, etc.)
"FURB", # refurb — more idiomatic patterns
"RUF", # Ruff-specific rules
]
ignore = [
"E501", # line length — the formatter handles this; linting it is just noise
"ISC001", # single-line implicit string concat — conflicts with the formatter
]
# Let Ruff auto-remove unused imports, sort imports, etc. on `ruff check --fix`.
fixable = ["ALL"]
unfixable = ["F401"] # but DON'T silently delete unused imports — make them visible first
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"] # re-exporting in package __init__ is intentional
"tests/**/*.py" = ["N802"] # allow non-PEP8 test method names (e.g. test_FooBar)
[tool.ruff.lint.pydocstyle]
convention = "google" # only matters if you later enable the "D" docstring rules
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
docstring-code-format = true # format code blocks inside your docstrings too
line-ending = "auto"