-
Notifications
You must be signed in to change notification settings - Fork 0
/
ruff.toml
142 lines (133 loc) · 4.23 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
## Set assumed Python version
target-version = "py311"
## Same as Black.
line-length = 88
## Enable pycodestyle ("E") and Pyflakes ("F") codes by default
# # Docs: https://beta.ruff.rs/docs/rules/
lint.select = [
"D", ## pydocstyle
"E", ## pycodestyle
"F401", ## remove unused imports
"I", ## isort
"I001", ## Unused imports
]
## Ignore specific checks.
# Comment lines in list below to "un-ignore."
# This is counterintuitive, but commenting a
# line in ignore list will stop Ruff from
# ignoring that check. When the line is
# uncommented, the check will be run.
lint.ignore = [
"D100", ## missing-docstring-in-public-module
"D101", ## missing-docstring-in-public-class
"D102", ## missing-docstring-in-public-method
"D103", ## Missing docstring in public function
"D105", ## Missing docstring in magic method
"D106", ## missing-docstring-in-public-nested-class
"D107", ## Missing docstring in __init__
"D200", ## One-line docstring should fit on one line
"D203", ## one-blank-line-before-class
"D205", ## 1 blank line required between summary line and description
"D213", ## multi-line-summary-second-line
"D401", ## First line of docstring should be in imperative mood
"E402", ## Module level import not at top of file
"D406", ## Section name should end with a newline
"D407", ## Missing dashed underline after section
"D414", ## Section has no content
"D417", ## Missing argument descriptions in the docstring for [variables]
"E501", ## Line too long
"E722", ## Do note use bare `except`
"F401", ## imported but unused
]
## Allow autofix for all enabled rules (when "--fix") is provided.
# NOTE: Leaving these commented until I know what they do
# Docs: https://beta.ruff.rs/docs/rules/
lint.fixable = [
# "A", ## flake8-builtins
# "B", ## flake8-bugbear
"C",
"D", ## pydocstyle
"E", ## pycodestyle-error
"E402", ## Module level import not at top of file
# "F", ## pyflakes
"F401", ## unused imports
# "G", ## flake8-logging-format
"I", ## isort
"N", ## pep8-naming
# "Q", ## flake8-quotas
# "S", ## flake8-bandit
"T",
"W", ## pycodestyle-warning
# "ANN", ## flake8-annotations
# "ARG", ## flake8-unused-arguments
# "BLE", ## flake8-blind-except
# "COM", ## flake8-commas
# "DJ", ## flake8-django
# "DTZ", ## flake8-datetimez
# "EM", ## flake8-errmsg
"ERA", ## eradicate
# "EXE", ## flake8-executables
# "FBT", ## flake8-boolean-trap
# "ICN", ## flake8-imort-conventions
# "INP", ## flake8-no-pep420
# "ISC", ## flake8-implicit-str-concat
# "NPY", ## NumPy-specific rules
# "PD", ## pandas-vet
# "PGH", ## pygrep-hooks
# "PIE", ## flake8-pie
"PL", ## pylint
# "PT", ## flake8-pytest-style
# "PTH", ## flake8-use-pathlib
# "PYI", ## flake8-pyi
# "RET", ## flake8-return
# "RSE", ## flake8-raise
"RUF", ## ruf-specific rules
# "SIM", ## flake8-simplify
# "SLF", ## flake8-self
# "TCH", ## flake8-type-checking
"TID", ## flake8-tidy-imports
"TRY", ## tryceratops
"UP", ## pyupgrade
# "YTT" ## flake8-2020
]
# unfixable = []
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".ruff_cache",
".venv",
"__pypackages__",
"__pycache__",
"*.pyc",
]
[lint.per-file-ignores]
"__init__.py" = ["D104"]
## Allow unused variables when underscore-prefixed.
# dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[lint.mccabe]
max-complexity = 10
[lint.isort]
combine-as-imports = true
force-sort-within-sections = true
force-wrap-aliases = true
## Use a single line after each import block.
lines-after-imports = 1
## Use a single line between direct and from import
lines-between-types = 1
## Order imports by type, which is determined by case,
# in addition to alphabetically.
order-by-type = true
relative-imports-order = "closest-to-furthest"
## Automatically add imports below to top of files
required-imports = ["from __future__ import annotations"]
## Define isort section priority
section-order = [
"future",
"standard-library",
"first-party",
"local-folder",
"third-party",
]