-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathruff.toml
More file actions
139 lines (135 loc) · 8.6 KB
/
Copy pathruff.toml
File metadata and controls
139 lines (135 loc) · 8.6 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
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
# See https://docs.astral.sh/ruff/configuration/
# For a full list of supported rules, see https://docs.astral.sh/ruff/rules/
# For a full list of options, see https://docs.astral.sh/ruff/settings/
target-version = "py39"
[lint]
ignore = [
"A001", # Variable {name} is shadowing a Python builtin
"A002", # Function argument {name} is shadowing a Python builtin
"ANN001", # Missing type annotation for function argument {name}
"ANN002", # Missing type annotation for *{name}
"ANN003", # Missing type annotation for **{name}
"ANN201", # Missing return type annotation for public function {name}
"ANN202", # Missing return type annotation for private function {name}
"ANN204", # Missing return type annotation for special method {name}
"ANN205", # Missing return type annotation for staticmethod {name}
"ANN206", # Missing return type annotation for classmethod {name}
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed in {name}
"ARG001", # Unused function argument: {name}
"ARG002", # Unused method argument: {name}
"B024", # {name} is an abstract base class, but it has no abstract methods or properties
"B904", # Within an except* clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling
"BLE001", # Do not catch blind exception: {name}
"C408", # Unnecessary {kind}() call (rewrite as a literal)
"C901", # {name} is too complex ({complexity} > {max_complexity})
"COM812", # Trailing comma missing
"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__
"D200", # One-line docstring should fit on one line
"D203", # Checks for docstrings on class definitions that are not preceded by a blank line.
"D205", # 1 blank line required between summary line and description
"D212", # Multi-line docstring summary should start at the first line
"D213", # Multi-line docstring 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: "{first_line}"
"D413", # Missing blank line after last section ("{name}")
"D415", # First line should end with a period, question mark, or exclamation point
"DTZ005", # datetime.datetime.now() called without a tz argument
"E501", # Line too long ({width} > {limit})
"E731", # Do not assign a lambda expression, use a def
"ERA001", # Found commented-out code
"F401", # {name} imported but unused; consider using importlib.util.find_spec to test for availability
"F403", # from {name} import * used; unable to detect undefined names
"F811", # Redefinition of unused {name} from {row}
"F821", # Undefined name {name}. {tip}
"F841", # Local variable {name} is assigned to but never used
"FBT001", # Boolean-typed positional argument in function definition
"FBT002", # Boolean default positional argument in function definition
"FBT003", # Boolean positional value in function call
"FIX002", # Line contains TODO, consider resolving the issue
"I001", # Import block is un-sorted or un-formatted
"ISC003", # Explicitly concatenated string should be implicitly concatenated
"N802", # Function name {name} should be lowercase
"N818", # Exception name {name} should be named with an Error suffix
"PERF203", # try-except within a loop incurs performance overhead
"PLC0415", # import should be at the top-level of a file
"PYI006", # Use < or >= for sys.version_info comparisons
"PYI024", # Use typing.NamedTuple instead of collections.namedtuple
"PLR0912", # Too many branches ({branches} > {max_branches})
"PLR0913", # Too many arguments in function definition ({c_args} > {max_args})
"PLR2004", # Magic value used in comparison, consider replacing {value} with a constant variable
"PLW2901", # Outer {outer_kind} variable {name} overwritten by inner {inner_kind} target
"PT015", # Assertion always fails, replace with pytest.fail()
"PT017", # Found assertion on exception {name} in except block, use pytest.raises() instead
"PT027", # Use pytest.raises instead of unittest-style {assertion}
"PT028", # Test function parameter {} has default argument
"PTH100", # os.path.abspath() should be replaced by Path.resolve()
"PTH103", # os.makedirs() should be replaced by Path.mkdir(parents=True)
"PTH107", # os.remove() should be replaced by Path.unlink()
"PTH110", # os.path.exists() should be replaced by Path.exists()
"PTH118", # os.{module}.join() should be replaced by Path with / operator
"PTH120", # os.path.dirname() should be replaced by Path.parent
"RET501", # Do not explicitly return None in function if it is the only possible return value
"RET503", # Missing explicit return at the end of function able to return non-None value
"RET504", # Unnecessary assignment to {name} before return statement
"RSE102", # Unnecessary parentheses on raised exception
"RUF005", # Consider {expression} instead of concatenation
"S101", # Use of assert detected
"S105", # Possible hardcoded password assigned to: "{}"
"S110", # try-except-pass detected, consider logging the exception
"S311", # Standard pseudo-random generators are not suitable for cryptographic purposes
"S603", # subprocess call: check for execution of untrusted input
"SIM102", # Use a single if statement instead of nested if statements
"SIM103", # Return the condition {condition} directly
"SIM105", # Use contextlib.suppress({exception}) instead of try-except-pass
"SIM108", # Use ternary operator {contents} instead of if-else-block
"SIM114", # Combine if branches using logical or operator
"SIM115", # Use a context manager for opening files
"SIM117", # Use a single with statement with multiple contexts instead of nested with statements
"SIM118", # Use key {operator} dict instead of key {operator} dict.keys()
"SIM300", # Yoda condition detected
"SIM910", # Use {expected} instead of {actual}
"SLF001", # Private member accessed: {access}
"SLOT002", # Subclasses of {namedtuple_kind} should define __slots__
"T201", # print found
"TC001", # Move application import {} into a type-checking block
"TC003", # Move standard library import {} into a type-checking block
"TD003", # Missing issue link for this TODO
"TD004", # Missing colon in TODO
"TD005", # Missing issue description after TODO
"TRY002", # Create your own exception
"TRY003", # Avoid specifying long messages outside the exception class
"TRY004", # Prefer TypeError exception for invalid type
"TRY203", # Remove exception handler; error is immediately re-raised
"TRY300", # Consider moving this statement to an else block
"TRY400", # Use logging.exception instead of logging.error
"TRY401", # Redundant exception object included in logging.exception call
"UP004", # Class {name} inherits from object
"UP006", # Use {to} instead of {from} for type annotation
"UP008", # Use super() instead of super(__class__, self)
"UP010", # Unnecessary __future__ import {import} for target Python version
"UP015", # Unnecessary mode argument
"UP018", # Unnecessary {literal_type} call (rewrite as a literal)
"UP024", # Replace aliased errors with OSError
"UP028", # Replace yield over for loop with yield from
"UP030", # Use implicit references for positional format fields
"UP031", # Use format specifiers instead of percent format
"UP032", # Use f-string instead of format call
"UP035", # Import from {target} instead: {names}
"UP036", # Version block is outdated for minimum Python version
"UP037", # Remove quotes from type annotation
"YTT201", # sys.version_info[0] == 3 referenced (python4), use >=
"YTT203", # sys.version_info[1] compared to integer (python4), compare sys.version_info to tuple
]
# Select all rules by default, and then ignore the ones we don't want.
# This is a good way to stay up-to-date with new rules in ruff.
select = ["ALL"]
# This is to suppress
# https://docs.astral.sh/ruff/rules/non-pep585-annotation/
# https://docs.astral.sh/ruff/rules/non-pep604-annotation-union/#non-pep604-annotation-union-up007
[lint.pyupgrade]
keep-runtime-typing = true