-
Notifications
You must be signed in to change notification settings - Fork 28
/
ruff.toml
138 lines (137 loc) · 7.08 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
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 - error in version 0.3.5 https://github.com/astral-sh/ruff/issues/10724
"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 = [
"S101", # Use of `assert` detected
"S105", # Possible hardcoded password assigned to: "TOKEN"
"Q000", # Single quotes found but double quotes preferred
"ARG001", # Unused function argument: `gcode`
"SIM105", # Use `...` instead of `try`-`except`-`pass`
"PGH003", # Use specific rule codes when ignoring type issues
"PLR2004", # Magic value used in comparison
"T201", # `print` found
"RUF100", # Unused `noqa` directive (unused: `E501`)
"A001", # Variable `dir` is shadowing a Python builtin
"SIM115", # Use context handler for opening files,
"C408", # Unnecessary `dict` call (rewrite as a literal)
"PT022", # No teardown in fixture `...`, use `return` instead of `yield`
"PT001", # Use `@pytest.fixture()` over `@pytest.fixture`
"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
"SIM117", # Use a single `with` statement with multiple contexts instead of nested `with` statements
"S108", # Probable insecure usage of temporary file or directory: "/tmp/c"
"ARG002", # Unused method argument
"N802", # Function name should be lowercase
"SIM201", # Use ` != ` instead of `not ==`
"PT015", # Assertion always fails, replace with `pytest.fail()`
"SLF001", # Private member accessed: `_running_loop`
"PT004", # Fixture `gcode` does not return anything, add leading underscore
"ISC003", # Explicitly concatenated string should be implicitly concatenated
"PLR0915", # Too many statements (63 > 50)
"ARG005", # Unused lambda argument
"TRY003", # Avoid specifying long messages outside the exception class
"ERA001", # Found commented-out code
"RET504", # Unnecessary variable assignment before `return` statement
"PLR0913", # Too many arguments to function call
"RET501", # Do not explicitly `return None` in function if it is the only possible return value
"C402", # Unnecessary generator (rewrite as a `dict` comprehension)
"PGH004", # Use specific rule codes when using `noqa`
"ISC002", # Implicitly concatenated string literals over multiple lines
"TRY300", # Consider moving this statement to an `else` block
"TRY301", # Abstract `raise` to an inner function
"TRY400", # `logging.exception` instead of `logging.error
"N818", # Exception name `UnknownGcodeFileType` should be named with an Error suffix
"B905", # `zip()` without an explicit `strict=` parameter
"SIM108", # Use ternary operator
"FLY002", # Consider `f'{ROOT}/{abs_path}'` instead of string join
"SIM102", # Use a single `if` statement instead of nested `if` statements
"BLE001", # Do not catch blind exception: `Exception`
"PLR5501", # Consider using `elif` instead of `else` then `if` to remove one indentation level
"RSE102", # Unnecessary parentheses on raised exception
"A003", # Class attribute `hash` is shadowing a Python builtin
"S311", # Standard pseudo-random generators are not suitable for cryptographic purposes
"ISC001", # Implicitly concatenated string literals on one line
"SIM110", # Use `return all(successor for successor in self)` instead of `for` loop
"S110", # `try`-`except`-`pass` detected, consider logging the exception
"C413", # Unnecessary `list` call around `sorted()`
"SIM114", # Combine `if` branches using logical `or` operator
"C417", # Unnecessary `map` usage (rewrite using a `set` comprehension
"C901", # `loop_step` is too complex
"PLR0912", # Too many branches
"INP001", # File is part of an implicit namespace package.
"B011", # Do not `assert False`
"PLW2901", # `for` loop variable `line` overwritten by assignment target
"S103", # `os.chmod` setting a permissive mask `0o777` on file or directory
"C400", # Unnecessary generator (rewrite as a `list` comprehension)
"PLR0911", # Too many return statements
"B007", # Loop control variable `i` not used within loop body
"PIE804", # Unnecessary `dict` kwargs
"S603", #`subprocess` call: check for execution of untrusted input
"S310", # Audit URL open for permitted schemes
"TCH001", # Move application import
"S701", # By default, jinja2 sets `autoescape` to `False`
"S324", # Probable use of insecure hash functions in `hashlib`: `md5`,
"PT018", # Assertion should be broken down into multiple parts
"A002", # Argument `format` is shadowing a Python builtin
"TRY201", # Use `raise` without specifying exception name
"TRY302", # Remove exception handler; error is immediately re-raised
"Q003", # Change outer quotes to avoid escaping inner quotes
"PLC1901", # `line == ""` can be simplified to `not line` as an empty string is falsey
"B008", # Do not perform function call `Event` in argument defaults
"B020", # Loop control variable `self` overrides iterable it iterates
"TCH003", # Move standard library import `re` into a type-checking block
"TRY401", # Redundant exception object included in `logging.exception` call
"PIE810", # Call `startswith` once with a `tuple`
"S607", # Starting a process with a partial executable path
"RUF005", # Consider `[sys.executable, "-m", "prusa.link", "restart", *argv]` instead of concatenation
"RUF015", # Prefer `next(iter(screen.lines()))` over single element slice
"S104", # Possible binding to all interfaces¸
]
line-length = 79