Skip to content

Commit df060a8

Browse files
committed
added ruff.toml
1 parent c944dcb commit df060a8

File tree

1 file changed

+99
-0
lines changed

1 file changed

+99
-0
lines changed

ruff.toml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# SPDX-FileCopyrightText: 2024 Tim Cocks for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
target-version = "py38"
6+
line-length = 100
7+
8+
[lint]
9+
preview = true
10+
select = ["I", "PL", "UP"]
11+
12+
extend-select = [
13+
"D419", # empty-docstring
14+
"E501", # line-too-long
15+
"W291", # trailing-whitespace
16+
"PLC0414", # useless-import-alias
17+
"PLC2401", # non-ascii-name
18+
"PLC2801", # unnecessary-dunder-call
19+
"PLC3002", # unnecessary-direct-lambda-call
20+
"PLE0101", # return-in-init
21+
"F706", # return-outside-function
22+
"F704", # yield-outside-function
23+
"PLE0116", # continue-in-finally
24+
"PLE0117", # nonlocal-without-binding
25+
"PLE0241", # duplicate-bases
26+
"PLE0302", # unexpected-special-method-signature
27+
"PLE0604", # invalid-all-object
28+
"PLE0605", # invalid-all-format
29+
"PLE0643", # potential-index-error
30+
"PLE0704", # misplaced-bare-raise
31+
"PLE1141", # dict-iter-missing-items
32+
"PLE1142", # await-outside-async
33+
"PLE1205", # logging-too-many-args
34+
"PLE1206", # logging-too-few-args
35+
"PLE1307", # bad-string-format-type
36+
"PLE1310", # bad-str-strip-call
37+
"PLE1507", # invalid-envvar-value
38+
"PLE2502", # bidirectional-unicode
39+
"PLE2510", # invalid-character-backspace
40+
"PLE2512", # invalid-character-sub
41+
"PLE2513", # invalid-character-esc
42+
"PLE2514", # invalid-character-nul
43+
"PLE2515", # invalid-character-zero-width-space
44+
"PLR0124", # comparison-with-itself
45+
"PLR0202", # no-classmethod-decorator
46+
"PLR0203", # no-staticmethod-decorator
47+
"UP004", # useless-object-inheritance
48+
"PLR0206", # property-with-parameters
49+
"PLR0904", # too-many-public-methods
50+
"PLR0911", # too-many-return-statements
51+
"PLR0912", # too-many-branches
52+
"PLR0913", # too-many-arguments
53+
"PLR0914", # too-many-locals
54+
"PLR0915", # too-many-statements
55+
"PLR0916", # too-many-boolean-expressions
56+
"PLR1702", # too-many-nested-blocks
57+
"PLR1704", # redefined-argument-from-local
58+
"PLR1711", # useless-return
59+
"C416", # unnecessary-comprehension
60+
"PLR1733", # unnecessary-dict-index-lookup
61+
"PLR1736", # unnecessary-list-index-lookup
62+
63+
# ruff reports this rule is unstable
64+
#"PLR6301", # no-self-use
65+
66+
"PLW0108", # unnecessary-lambda
67+
"PLW0120", # useless-else-on-loop
68+
"PLW0127", # self-assigning-variable
69+
"PLW0129", # assert-on-string-literal
70+
"B033", # duplicate-value
71+
"PLW0131", # named-expr-without-context
72+
"PLW0245", # super-without-brackets
73+
"PLW0406", # import-self
74+
"PLW0602", # global-variable-not-assigned
75+
"PLW0603", # global-statement
76+
"PLW0604", # global-at-module-level
77+
78+
# fails on the try: import typing used by libraries
79+
#"F401", # unused-import
80+
81+
"F841", # unused-variable
82+
"E722", # bare-except
83+
"PLW0711", # binary-op-exception
84+
"PLW1501", # bad-open-mode
85+
"PLW1508", # invalid-envvar-default
86+
"PLW1509", # subprocess-popen-preexec-fn
87+
"PLW2101", # useless-with-lock
88+
"PLW3301", # nested-min-max
89+
]
90+
91+
ignore = [
92+
"PLR2004", # magic-value-comparison
93+
"UP030", # format literals
94+
"PLW1514", # unspecified-encoding
95+
96+
]
97+
98+
[format]
99+
line-ending = "lf"

0 commit comments

Comments
 (0)