-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathruff.toml
50 lines (47 loc) · 2.84 KB
/
ruff.toml
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
line-length = 120
extend-include = ["docs/**/*.py", "tests/**/*.py"]
exclude = ["__init__.py", "main/COMO.ipynb"]
[format]
quote-style = "double"
docstring-code-format = true
[lint]
# Linting rules: https://docs.astral.sh/ruff/rules/
select = [
"A", # do not use python builtins for variables or parameters; https://pypi.org/project/flake8-builtins/
"ASYNC", # identify asynchronous-related problems; https://pypi.org/project/flake8-async/
"B", # find likely bugs and design problems; https://pypi.org/project/flake8-bugbear/
"C4", # create better list, set, & dict comprehensions; https://pypi.org/project/flake8-comprehensions/
"C90", # check for complexity; https://pypi.org/project/mccabe/
"D", # docstring style checker; https://pypi.org/project/pydocstyle/
"DOC", # docstring linter; https://pypi.org/project/pydoclint/
"E", # style guide checking; https://pypi.org/project/pycodestyle/
"F", # check for errors; https://pypi.org/project/pyflakes/
"RUF", # ruff-specific linting rules; https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf
"FA", # use from __future__ import annotations if needed; https://pypi.org/project/flake8-future-annotations/
"FURB", # refurbish and modernize Python codebases; https://pypi.org/project/refurb/
"I", # sorting imports rules; https://pypi.org/project/isort/
"N", # check naming conventions; https://pypi.org/project/pep8-naming/
"PERF", # check performance anti-patterns; https://pypi.org/project/perflint/
"PT", # check common style issues or inconsistencies in pytest; https://pypi.org/project/flake8-pytest-style/
"PTH", # use pathlib where possible; https://pypi.org/project/flake8-use-pathlib/
"S", # security testing; https://pypi.org/project/flake8-bandit/
"SIM", # check for code that can be simplified; https://pypi.org/project/flake8_simplify/
"T20", # do not use prints in production; https://pypi.org/project/flake8-print/
"TRY", # prevent Exception handling anti-patterns; https://pypi.org/project/tryceratops/
"UP" # upgrade syntax for newer versions; https://pypi.org/project/pyupgrade
]
ignore = [
"D100", # allow undocumented public module definitions
"D101", # allow undocumented public class
"D203", # do not require one blank line before class docstring
"D213", # first docstring line should be on the second line
"TRY003", # allow exception messages outside the `Exception` class
"F401", # allow unused imports
]
[lint.per-file-ignores]
"tests/*" = [
"D101", # allow undocumented public class
"D102", # allow undocumented class method
"D103", # allow undocumented public method definitions
"S101", # allow use of `assert` in test files
]