-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathruff.toml
122 lines (114 loc) · 5.33 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
preview = true
exclude = []
lint.select = ["ALL"]
lint.extend-ignore = [
"A", # Shadowing builtins
"ANN", # flake8-annotations
"ARG", # flake8-unused-arguments
"COM", # flake8-commas
"D", # pydocstyle
"FBT", # flake8-boolean-trap
"FIX", # flake8-fixme
"PERF", # Perflint
"PGH", # pygrep-hooks
"TD", # flake8-todos
"TRY", # tryceratops
"DOC", # pydocstyle
"PTH", # Pathlib
# False positive, don't remove (unless you know exactly what you're doing)
"E203", # whitespace before ':'
"E711", # comparison to None should be 'if cond is not None:'
"E712", # ...
"E713", # Test for membership should be `not in`
"ERA001", # Found commented-out code
"ISC001", # Conflicts with formatter
"PLR2044", # Line with empty comment
"PLW1514", # `open` in text mode without explicit `encoding` argument
"S101", # Use of `assert` detected
"S320", # OK, we're using defusedxml
# Fix these (if possible / reasonable)
# "B903", # Class could be a dataclass
"B027", # `...` is an empty method in an abstract base class, but has no abstract decorator
"B028", # No explicit `...` keyword argument found
"BLE001", # Do not catch blind exception
"C901", # X is too complex
#
"DTZ001", # The use of `datetime.datetime()` without `tzinfo` argument is not allowed
"DTZ003", # The use of `datetime.datetime.utcnow()` is not allowed, use `datetime.datetime.now(tz=)` instead
"DTZ004", # The use of `datetime.datetime.utcfromtimestamp()` is not allowed, use `datetime.datetime.fromtimestamp(ts, tz=)` instead
"DTZ005", # The use of `datetime.datetime.now()` without `tz` argument is not allowed
"DTZ007", # The use of `datetime.datetime.strptime()` without %z must be followed by `.replace(tzinfo=)` or `.astimezone()`
#
"E501", # line too long
"E741", # Ambiguous variable name
"FURB113", # Use `x.extend(...)` instead of repeatedly calling `x.append()`
#
"N801", # Class name should use CapWords convention
"N802", # Function name should be lowercase
"N803", # Argument name should be lowercase
"N804", # First argument of a class method should be named `cls`
"N805", # First argument of a method should be named `self`
"N806", # Variable in function should be lowercase
#
"PD011", # Use `.to_numpy()` instead of `.values`
"PLC0206", # Extracting value from dictionary without calling `.items()`
"PLC0415", # `import` should be at the top-level of a file
"PLC1901", # `x == ""` can be simplified to `not x` as an empty string is falsey
"PLC2801", # Unnecessary dunder call
"PLR0904", # Too many public methods (22 > 20)
"PLR0911", # Too many return statements
"PLR0912", # Too many branches
"PLR0913", # Too many arguments in function definition
"PLR0914", # Too many local variables
"PLR0915", # Too many statements
"PLR0917", # Too many positional arguments
"PLR2004", # Magic value used in comparison
"PLR6201", # Use a `set` literal when testing for membership
"PLR6301", # Method could be a function, class method, or static method
"PLW2901", # `for` loop variable overwritten by assignment target
"PLW3201", # Bad or misspelled dunder method name. (bad-dunder-name)
#
"PT011", # `pytest.raises(ValueError)` is too broad, set the `match` parameter or use a more specific exception
"PT012", # `pytest.raises()` block should contain a single simple statement
"PT013", # Found incorrect import of pytest, use simple `import pytest` instead
#
"PYI024", # Use `typing.NamedTuple` instead of `collections.namedtuple`
"RET503", # Missing explicit `return` at the end of function able to return non-`None` value
"RET504", # Unnecessary variable assignment before `return` statement
"RET505", # Unnecessary `else` after `return` statement
#
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
#
"S301", # `pickle`...
"S403", # `pickle`, `cPickle`, `dill`, and `shelve` modules are possibly insecure
"S404", # `subprocess` module is possibly insecure
"S405", # lxml` is vulnerable to XML attacks
"S603", # Subprocess related...
"S605", # Subprocess related...
"S607", # Starting a process with a partial executable path
"S701", # By default, jinja2 sets `autoescape` to `False`.
#
"SIM102", # Use a single `if` statement instead of nested `if` statements
"SIM108", # Use ternary operator
"SIM115", # Use context handler for opening files
"SIM117", # Use a single `with` statement with multiple contexts instead of nested `with` statements
"SLF001", # Private member accessed
# More
"T201", # `print` found
"TRY002", # Create you own exception class
"TC006", # Add quotes to type expression in `typing.cast()`
"RUF052", # Local dummy variable is accessed
"RUF035", # Unsafe use of `markupsafe.Markup` detected
"RUF036", # `None` not at the end of the type annotation.
"FURB189", # Subclassing `dict` can be error prone, use `collections.UserDict` instead
# Missing copyright
"CPY001",
]
[lint.per-file-ignores]
"tests/**/*.py" = ["INP001"] # implicit namespace packages
"**/__init__.py" = ["F401"] # 'module' imported but unused
[lint.mccabe]
max-complexity = 10
[lint.isort]
combine-as-imports = true
required-imports = ["from __future__ import annotations"]