-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathruff.toml
More file actions
60 lines (56 loc) · 2.55 KB
/
ruff.toml
File metadata and controls
60 lines (56 loc) · 2.55 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
56
57
58
59
60
target-version = "py313"
line-length = 88 # Same as Black.
[format]
docstring-code-format = true
docstring-code-line-length = 72
[lint]
preview = true # Allow preview rules.
extend-select = [
"A", # Flake8-builtins - misuse of Python built-in names
"B", # bugbear
"BLE", # Flake8-blind-except - flags bare excepts
"C4", # Flake8-comprehensions - best practices in comprehensions
"C90", # McCabe - code complexity metric for functions
"COM", # Flake8-commas - trailing/comma issues
"D", # Pydocstyle - docstring formatting
"DOC", # Pydoclint - docstring linting and consistency
"E", # Pycodestyle errors
"EM", # Flake8-errmsg - error message style
"F", # pyflakes
"FAST", # FastAPI - FastAPI-specific linting rules
"FBT", # Flake8-boolean-trap - potential pitfalls with booleans
"FURB", # Refurb - rules for code refurbishment
"G", # Flake8-logging-format - logging format string issues
"I", # isort - import ordering
"ICN", # Flake8-import-conventions - enforces conventional import aliases
"LOG", # Flake8-logging - proper logging usage
"N", # PEP8 Naming
"NPY", # NumPy-specific rules - ensures NumPy coding standards
"PD", # Pandas-vet - checks pandas-specific code practices
"PERF", # Perflint - performance-related checks
"PL", # Pylint rules
"PT", # Flake8-pytest-style - pytest best practices
"Q", # Flake8-quotes - enforces quote style consistency
"RUF", # Ruff-specific rules - additional Ruff checks
"S", # Flake8-bandit - security issues
"SIM", # Flake8-simplify - code simplification hints
"UP", # Pyupgrade - upgraded syntax to newer Python versions
"W", # Pycodestyle warnings
]
ignore = [
"COM812", # Redundant with ruff formatter. See: https://docs.astral.sh/ruff/rules/missing-trailing-comma/
"G004", # f-strings are allowed with the loguru module. See https://docs.astral.sh/ruff/rules/logging-f-string/
"PLR", # No Pylint recommendations
]
# Force numpy-style for docstrings
# https://docs.astral.sh/ruff/faq/#does-ruff-support-numpy-or-google-style-docstrings
[lint.pydocstyle]
convention = "numpy"
# From https://github.com/astral-sh/ruff/issues/4368
[lint.extend-per-file-ignores]
"tests/**/*.py" = [
# at least this three should be fine in tests:
"S101", # asserts allowed in tests...
"ARG", # Unused function args -> fixtures nevertheless are functionally relevant...
"FBT", # Don't care about booleans as positional arguments in tests, e.g. via @pytest.mark.parametrize()
]