-
Notifications
You must be signed in to change notification settings - Fork 30
/
ruff.toml
140 lines (132 loc) · 5.71 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
target-version = "py310"
line-length = 120
extend-exclude = ["scripts/*.py"]
[lint]
select = [
"F", # pyflakes
"E", # pycodestyle errors
"W", # pycodestyle warnings
"C90", # mccabe
"I", # isort
"D", # pydocstyle
"N", # pep8-naming
"UP", # pyupgrade
"YTT", # flake8-2020
"ANN001", # missing type annotation for arguments
"ANN002", # missing type annotation for *args
"ANN003", # missing type annotation for **kwargs
"ASYNC", # flake8-async
"S", # flake8-bandit
"BLE", # flake8-blind-except
"FBT003", # flake8-boolean-trap
"B", # flake8-bugbear
"COM", # flake8-commas
"C4", # flake8-comprehensions
"T10", # flake8-debugger
"EXE", # flake8-executable
"ISC", # flake8-implicit-str-concat
"G010", # Logging statement uses warn instead of warning
"G201", # Logging .exception(...) should be used instead of .error(..., exc_info=True)
"G202", # Logging statement has redundant exc_info
"INP", # flake8-no-pep420
"PIE", # flake8-pie
"T20", # flake8-print
"PYI", # flake8-pyi
"PT", # flake8-pytest-style
"Q", # flake8-quotes
"RSE", # flake8-raise
"RET", # flake8-return
"SIM", # flake8-simplify
"TCH", # flake8-type-checking
"ARG", # flake8-unused-arguments
"PTH", # flake8-use-pathlib
"ERA", # flake8-eradicate
"LOG", # flake8-logging
"G", # flake8-logging-format
"PGH", # pygrep-hooks
"PL", # pylint
"PLC0414", # Import alias does not rename original package
"PLE", # Error
"PLW", # Warning
"TRY", # tryceratops
"FLY", # flynt
"PERF", # Perflint
"RUF", # ruff-specific rules
# Framework-specific
"DJ", # flake8-django
"NPY", # NumPy specific rules
"FAST", # FastAPI linting
"AIR", # flake8-airflow
]
unfixable = [
"ERA001", # eradicate: found commented out code (can be dangerous if fixed automatically)
]
ignore = [
### The following rules are recommended to be ignored by ruff when using ruff format ###
"W191", # Checks for indentation that uses tabs
"E111", # Checks for indentation with a non-multiple of 4 spaces
"E114", # Checks for indentation of comments with a non-multiple of 4 spaces
"E117", # Checks for over-indented code
"A", # flake8-builtins
"EM", # flake8-errmsg
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
"D105", # Missing docstring in magic method
"D106", # Missing docstring in public nested class
"D107", # Missing docstring in __init__
"D213", # Multi-line docstring summary should start at the second line
"D400", # First line should end with a period
"D415", # First line should end with a period, question mark, or exclamation point
"D206", # Checks for docstrings that are indented with tabs
"D300", # Checks for docstrings that use '''single quotes''' instead of """double quotes"""
"Q000", # Checks for inline strings that use single quotes or double quotes
"Q001", # Checks for multiline strings that use single quotes or double quotes
"Q002", # Checks for docstrings that use single quotes or double quotes
"Q003", # Checks for strings that include escaped quotes
"COM812", # Checks for the absence of trailing commas
"COM819", # Checks for the presence of prohibited trailing commas
"ISC001", # Checks for implicitly concatenated strings on a single line
"ISC002", # Checks for implicitly concatenated strings that span multiple lines
"FURB", # Refurb # TODO: Try integrating this one back but ignore some of the rules
"PL", # pylint
"TD", # flake8-todos
"DOC", # pydocstyle
"RUF029",
### The other rules ###
"D203", # 1 blank line required before class docstring
"ARG001", # Unused first argument
"ARG002", # Unused method argument
"TRY003", # Avoid specifying long messages outside the exception class
"TRY300", # Consider moving statement into the else clause
"PT019", # Fixture without value is injected as parameter, use @pytest.mark.usefixtures instead
# (usefixtures doesn't play well with IDE features such as auto-renaming)
"SIM108", # Use ternary operator instead of if-else block (ternaries lie to coverage)
"RET505", # Unnecessary `else` after `return` statement
"N805", # First argument of a method should be named `self` (pydantic validators don't play well with this)
"UP007", # Use `X | Y` for type annotations (we need this for testing and our runtime logic)
"RET506", # Unnecessary `elif` after `raise` statement
]
[lint.per-file-ignores]
"**/tests/*" = [
"S", # ignore bandit security issues in tests
"B018", # ignore useless expressions in tests
"PT012", # ignore complex with pytest.raises clauses
"RUF012", # ignore mutable class attributes ClassVar typehint requirement
"ANN001", # Missing type annotation for function argument
"ANN002", # Missing type annotation for *args
"ANN003", # Missing type annotation for **kwargs
"PGH003", # Use specific rule codes when ignoring type issues
"B008", # Do not perform function call in argument defaults
]
"cadwyn/_utils.py" = [
"ERA001", # Found commented-out code (it's not actually commented out. It's just comments)
]
[lint.mccabe]
max-complexity = 14
[format]
quote-style = "double"
indent-style = "space"
docstring-code-format = true