-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
ruff.toml
134 lines (131 loc) · 7.03 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
line-length = 79
lint.select = [
"F", # pyflakes
"E", # pycodestyle
"W", # pycodestyle
"C90", # mccabe
"I", # isort
"N", # pep8-naming
# "D", # pydocstyle
# "UP", # pyupgrade
"YTT", # flake8-2020
# "ANN", # flake8-annotations
"S", # flake8-bandit
# "BLE", # flake8-blind-except
# "FBT", # flake8-boolean-trap
"B", # flake8-bugbear
"A", # flake8-builtins
"COM", # flake8-commas
"C4", # flake8-comprehensions
"DTZ", # flake8-datetimez
"T10", # flake8-debugger
"DJ", # flake8-django
"EM", # flake8-errmsg
"EXE", # flake8-executable
"ISC", # flake8-implicit-str-concat
"ICN", # flake8-import-conventions
"G", # flake8-logging-format
"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
"SLF", # flake8-self
"SIM", # flake8-simplify
# "TID", # flake8-tidy-imports
"TCH", # flake8-type-checking
"INT", # flake8-gettext
"ARG", # flake8-unused-arguments
# "PTH", # flake8-use-pathlib
"ERA", # eradicate
"PD", # pandas-vet
"PGH", # pygrep-hooks
"PL", # Pylint
"TRY", # tryceratops
"FLY", # flynt
"NPY", # NumPy-specific rules
"RUF", # Ruff-specific rules
]
lint.ignore = [
"Q000", # [*] Single quotes found but double quotes preferred
"I001", # [*] Import block is un-sorted or un-formatted
"COM812", # [*] Trailing comma missing
"COM819", # [*] Trailing comma prohibited
"Q003", # [*] Change outer quotes to avoid escaping inner quotes
"S101", # Use of `assert` detected
"T201", # `print` found
"SLF001", # Private member accessed: `_sock`
"E501", # Line too long (92 > 88 characters)
"PLR2004", # Magic value used in comparison, consider replacing 2 with a constant variable
"RET503", # [*] Missing explicit `return` at the end of function able to return non-`None` value
"RET505", # Unnecessary `elif` after `return` statement
"PLR0912", # Too many branches (14 > 12)
"C901", # `application` is too complex (14 > 10)
"EXE001", # Shebang is present but file is not executable
"EXE003", # Shebang should contain `python`
"SIM115", # Use context handler for opening files
"PT001", # [*] Use `@pytest.fixture()` over `@pytest.fixture`
"PT013", # Found incorrect import of pytest, use simple `import pytest` instead
"C408", # [*] Unnecessary `dict` call (rewrite as a literal)
"EM101", # [*] Exception must not use a string literal, assign to variable first
"TRY003", # Avoid specifying long messages outside the exception class
"TRY300", # Consider moving this statement to an `else` block
"TRY301", # Abstract `raise` to an inner function
"B028", # No explicit `stacklevel` keyword argument found
"B007", # [*] Loop control variable `i` not used within loop body
"S603", # `subprocess` call: check for execution of untrusted input
"S607", # Starting a process with a partial executable path
"N812", # Lowercase `error` imported as non-lowercase `SocketError`
"PGH003", # Use specific rule codes when ignoring type issues
"YTT204", # `sys.version_info.minor` compared to integer (python4), compare `sys.version_info` to tuple
"SIM117", # Use a single `with` statement with multiple contexts instead of nested `with` statements
"PT012", # `pytest.raises()` block should contain a single simple statement
"RSE102", # [*] Unnecessary parentheses on raised exception
"B011", # [*] Do not `assert False` (`python -O` removes these calls), raise `AssertionError()`
"PT015", # Assertion always fails, replace with `pytest.fail()`
"N818", # Exception name `Found` should be named with an Error suffix,
"RET504", # Unnecessary variable assignment before `return` statement
"F841", # [*] Local variable `accepted` is assigned to but never used
"F401", # [*] `time.time` imported but unused
"RUF005", # [*] Consider `[('share/doc/poorwsgi', ['doc/ChangeLog', 'doc/licence.txt', 'README.rst', 'CONTRIBUTION.rst']), *find_data_files('examples', 'share/poorwsgi/examples')]` instead of concatenation
"G010", # [*] Logging statement uses `warn` instead of `warning`
"PGH002", # `warn` is deprecated in favor of `warning`
"C400", # [*] Unnecessary generator (rewrite as a `list` comprehension)
"N813", # Camelcase `FileIO` imported as lowercase `file`
"PLW2901", # `for` loop variable `key` overwritten by assignment target
"TRY400", # Use `logging.exception` instead of `logging.error`
"ERA001", # [*] Found commented-out code
"B905", # `zip()` without an explicit `strict=` parameter
"PLR0911", # Too many return statements (9 > 6)
"PLR0913", # Too many arguments to function call (6 > 5)
"TRY004", # Prefer `TypeError` exception for invalid type
"SIM102", # Use a single `if` statement instead of nested `if` statements
"ARG004", # Unused static method argument: `compresslevel`
"ARG002", # Unused method argument: `start_response`
"G001", # Logging statement uses `string.format()`
"SIM108", # [*] Use ternary operator `val = CgiFieldStorage.getlist(self, key) if key in self else default or []` instead of `if`-`else`-block
"A003", # Class attribute `input` is shadowing a Python builtin
"SIM108", # [*] Use ternary operator `val = CgiFieldStorage.getlist(self, key) if key in self else default or []` instead of `if`-`else`-block
"A003", # Class attribute `input` is shadowing a Python builtin
"C402", # [*] Unnecessary generator (rewrite as a `dict` comprehension)
"C417", # [*] Unnecessary `map` usage (rewrite using a generator expression)
"PLR0915", # Too many statements (52 > 50)
"EM103", # [*] Exception must not use a `.format()` string directly, assign to variable first
"DTZ003", # The use of `datetime.datetime.utcnow()` is not allowed, use `datetime.datetime.now(tz=)` instead
"PGH004", # Use specific rule codes when using `noqa`
"INP001", # File `examples/websocket.py` is part of an implicit namespace package. Add an `__init__.py`.
"ARG001", # Unused function argument: `req`
"S324", # Probable use of insecure hash functions in `hashlib`: `md5`
"SIM118", # [*] Use `key in req.form` instead of `key in req.form.keys()`
"SIM105", # [*] Use `contextlib.suppress(SessionError)` instead of `try`-`except`-`pass`
"PIE810", # [*] Call `startswith` once with a `tuple`
"C414", # [*] Unnecessary `tuple` call within `sorted()`
"TRY401", # Redundant exception object included in `logging.exception` call¸
"TRY002", # Create your own exception
"E402", # Module level import not at top of file
"RUF100", # [*] Unused blanket `noqa` directive
"RUF010", # [*] Use conversion in f-string
]