|
2 | 2 | requires = ["setuptools>=57", "wheel"] |
3 | 3 | build-backend = "setuptools.build_meta" |
4 | 4 |
|
5 | | - |
6 | | -[tool.flake8] |
7 | | -exclude = ".venv" |
8 | | -max-complexity = 10 |
9 | | -max-line-length = 120 |
10 | | -extend-ignore = """ |
11 | | - W503, |
12 | | - E203, |
13 | | - E701, |
14 | | - C901, |
15 | | -""" |
16 | | -per-file-ignores = """ |
17 | | - __init__.py: F401 |
18 | | -""" |
19 | | - |
20 | | -[tool.black] |
21 | | -line-length = 120 |
22 | | - |
23 | | -[tool.isort] |
24 | | -line_length = 120 |
25 | | -profile = "black" |
26 | | - |
27 | 5 | [tool.bandit] |
28 | 6 | target = ["test", "roboflow"] |
29 | 7 | tests = ["B201", "B301"] |
30 | 8 |
|
31 | | -[tool.autoflake] |
32 | | -check = true |
33 | | -imports = ["cv2", "roboflow"] |
34 | | - |
35 | 9 | [tool.ruff] |
36 | 10 | target-version = "py38" |
37 | | -# Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default. |
38 | | -select = ["E", "F"] |
39 | | -ignore = [] |
| 11 | +line-length = 120 |
40 | 12 |
|
41 | | -# Allow autofix for all enabled rules (when `--fix`) is provided. |
42 | | -fixable = [ |
| 13 | +[tool.ruff.lint] |
| 14 | +select = [ |
| 15 | + "ALL", |
| 16 | +] |
| 17 | +ignore = [ |
43 | 18 | "A", |
44 | | - "B", |
45 | | - "C", |
46 | | - "D", |
47 | | - "E", |
48 | | - "F", |
49 | | - "G", |
50 | | - "I", |
51 | | - "N", |
52 | | - "Q", |
53 | | - "S", |
54 | | - "T", |
55 | | - "W", |
56 | 19 | "ANN", |
57 | 20 | "ARG", |
| 21 | + "B", |
58 | 22 | "BLE", |
| 23 | + "C", |
59 | 24 | "COM", |
60 | | - "DJ", |
| 25 | + "D", |
61 | 26 | "DTZ", |
62 | 27 | "EM", |
63 | 28 | "ERA", |
64 | | - "EXE", |
65 | 29 | "FBT", |
66 | | - "ICN", |
67 | | - "INP", |
| 30 | + "FIX", |
| 31 | + "FLY", |
| 32 | + "FURB", |
68 | 33 | "ISC", |
69 | | - "NPY", |
70 | | - "PD", |
71 | | - "PGH", |
| 34 | + "N", |
| 35 | + "PERF", |
72 | 36 | "PIE", |
73 | | - "PL", |
| 37 | + "PLR", |
| 38 | + "PLW", |
74 | 39 | "PT", |
75 | 40 | "PTH", |
76 | | - "PYI", |
77 | 41 | "RET", |
78 | | - "RSE", |
79 | 42 | "RUF", |
| 43 | + "S", |
80 | 44 | "SIM", |
81 | 45 | "SLF", |
82 | | - "TCH", |
83 | | - "TID", |
| 46 | + "T", |
| 47 | + "TD", |
84 | 48 | "TRY", |
85 | | - "UP", |
86 | | - "YTT", |
87 | 49 | ] |
88 | | -unfixable = [] |
89 | 50 |
|
90 | 51 | # Exclude a variety of commonly ignored directories. |
91 | 52 | exclude = [ |
@@ -116,31 +77,26 @@ exclude = [ |
116 | 77 | "tests/manual/debugme.py", # file is intentionally broken |
117 | 78 | ] |
118 | 79 |
|
119 | | -# Same as Black. |
120 | | -line-length = 120 |
121 | 80 |
|
122 | 81 | # Allow unused variables when underscore-prefixed. |
123 | 82 | dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" |
124 | 83 |
|
125 | | -[tool.ruff.flake8-quotes] |
126 | | -inline-quotes = "double" |
127 | | -multiline-quotes = "double" |
128 | | -docstring-quotes = "double" |
129 | | - |
130 | | -[tool.ruff.pydocstyle] |
| 84 | +[tool.ruff.lint.pydocstyle] |
131 | 85 | convention = "google" |
132 | 86 |
|
133 | | -[tool.ruff.per-file-ignores] |
134 | | -"__init__.py" = ["E402", "F401"] |
| 87 | +[tool.ruff.lint.per-file-ignores] |
| 88 | +"__init__.py" = [ |
| 89 | + "E402", # Module level import not at top of file |
| 90 | + "F401", # Imported but unused |
| 91 | +] |
135 | 92 |
|
136 | | -[tool.ruff.pylint] |
137 | | -max-args = 20 |
| 93 | +[tool.ruff.lint.pyupgrade] |
| 94 | +# Preserve types, even if a file imports `from __future__ import annotations`. |
| 95 | +keep-runtime-typing = true |
138 | 96 |
|
139 | 97 | [tool.mypy] |
140 | 98 | python_version = "3.8" |
141 | | -exclude = [ |
142 | | - "^build/" |
143 | | -] |
| 99 | +exclude = ["^build/"] |
144 | 100 |
|
145 | 101 | [[tool.mypy.overrides]] |
146 | 102 | module = [ |
|
0 commit comments