-
Notifications
You must be signed in to change notification settings - Fork 0
/
ruff.toml
52 lines (49 loc) · 2.03 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
51
52
# This file is used to configure the Ruff linter and formatter:
# View the documentation for more information on how to configure this file below
# https://docs.astral.sh/ruff/linter/
# https://docs.astral.sh/ruff/formatter/
line-length = 120
src = ["src"]
extend-include = ["*.ipynb"]
target-version = "py310"
[format]
quote-style = "double"
indent-style = "space"
docstring-code-format = true
docstring-code-line-length = "dynamic"
[lint]
select = [
"F", # Errors detected by Pyflakes
"E", # Error detected by Pycodestyle
"W", # Warning detected by Pycodestyle
"I", # isort
"D", # pydocstyle
"B", # flake8-bugbear
"TID", # flake8-tidy-imports
"C4", # flake8-comprehensions
"BLE", # flake8-blind-except
"UP", # pyupgrade
"RUF100", # Report unused noqa directives
"NPY", # NumPy-specific rules
"PD", # Pandas code
"PTH", # pathlib
]
ignore = [
"B008", # Errors from function calls in argument defaults. These are fine when the result is immutable.
"D100", # Missing docstring in public module
"D104", # Missing docstring in public package
"D105", # __magic__ methods are often self-explanatory, allow missing docstrings
"D107", # Missing docstring in __init__
# Disable one in each pair of mutually incompatible rules
"D203", # We don’t want a blank line before a class docstring
"D213", # <> We want docstrings to start immediately after the opening triple quote
"D400", # first line should end with a period [Bug: doesn’t work with single-line docstrings]
"D401", # First line should be in imperative mood; try rephrasing
"E501", # line too long -> we accept long comment lines; formatter gets rid of long code lines
"E731", # Do not assign a lambda expression, use a def -> lambda expression assignments are convenient
"E741", # allow I, O, l as variable names -> I is the identity matrix
]
per-file-ignores."*/__init__.py" = ["F401"]
per-file-ignores."docs/*" = ["I"]
per-file-ignores."tests/*" = ["D"]
pydocstyle.convention = "numpy"