-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathruff.toml
More file actions
105 lines (94 loc) · 3.24 KB
/
Copy pathruff.toml
File metadata and controls
105 lines (94 loc) · 3.24 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
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
target-version = 'py310'
src = ['statsd']
exclude = [
'.tox',
'pystatsd',
'build',
'dist',
]
line-length = 79
[lint]
ignore = [
'A001', # Variable {name} is shadowing a Python builtin
'A002', # Argument {name} is shadowing a Python builtin
'A003', # Class attribute {name} is shadowing a Python builtin
'B023', # function-uses-loop-variable
'D205', # blank-line-after-summary
'D212', # multi-line-summary-first-line
'RET505', # Unnecessary `else` after `return` statement
'TRY003', # Avoid specifying long messages outside the exception class
'RET507', # Unnecessary `elif` after `continue` statement
'C405', # Unnecessary {obj_type} literal (rewrite as a set literal)
'C406', # Unnecessary {obj_type} literal (rewrite as a dict literal)
'C408', # Unnecessary {obj_type} call (rewrite as a literal)
'SIM114', # Combine `if` branches using logical `or` operator
'RET506', # Unnecessary `else` after `raise` statement
'Q001', # Remove bad quotes
'Q002', # Remove bad quotes
'FA100', # Missing `from __future__ import annotations`
'COM812', # Missing trailing comma in a list
'ISC001', # String concatenation with implicit str conversion
'SIM108', # Ternary operators are not always more readable
'RUF100', # Unused noqa directives
'D203', # 1 blank line required before class docstring, conflicts with D211
'D213', # Multi-line summary should start at the second line
'D400', # First line should end with a period
'D401', # First line of docstring should be in imperative mood
'D415', # First line should end with a period, question mark or exclamation point
]
select = [
'A', # flake8-builtins
'ASYNC', # flake8 async checker
'B', # flake8-bugbear
'C4', # flake8-comprehensions
'C90', # mccabe
'COM', # flake8-commas
'D', # pydocstyle: every module, class and function carries a docstring
'E', # pycodestyle error ('W' for warning)
'F', # pyflakes
'FA', # flake8-future-annotations
'I', # isort
'ICN', # flake8-import-conventions
'INP', # flake8-no-pep420
'ISC', # flake8-implicit-str-concat
'N', # pep8-naming
'PERF', # perflint
'PIE', # flake8-pie
'Q', # flake8-quotes
'RET', # flake8-return
'RUF', # Ruff-specific rules
'SIM', # flake8-simplify
'T20', # flake8-print
'TD', # flake8-todos
'TRY', # tryceratops
'UP', # pyupgrade
]
[lint.per-file-ignores]
'tests/*' = ['SIM115', 'SIM117', 'T201', 'B007', 'INP001', 'D'] # test names carry the intent
'conftest.py' = ['INP001', 'D']
'examples/*' = ['INP001', 'T201'] # standalone scripts, meant to be run and to print
'docs/*' = ['INP001', 'RUF012', 'A001', 'T201'] # record_demo.py reports what it recorded
[lint.isort]
case-sensitive = true
combine-as-imports = true
force-wrap-aliases = true
[lint.flake8-quotes]
docstring-quotes = 'single'
inline-quotes = 'single'
multiline-quotes = 'single'
[format]
line-ending = 'lf'
indent-style = 'space'
quote-style = 'single'
docstring-code-format = true
skip-magic-trailing-comma = false
exclude = [
'__init__.py',
]
[lint.pydocstyle]
convention = 'pep257'
ignore-decorators = ['typing.overload']
[lint.pycodestyle]
max-line-length = 79
[lint.flake8-pytest-style]
mark-parentheses = true