@@ -147,9 +147,7 @@ exclude = [
147
147
# Same as Black.
148
148
line-length = 127
149
149
indent-width = 4
150
-
151
- # Assume Python 3.13
152
- target-version = " py313"
150
+ target-version = " py39" # Minimum supported version of Python
153
151
output-format = " full"
154
152
155
153
[tool .ruff .lint ]
@@ -235,6 +233,7 @@ ignore = [
235
233
" E111" , # Conflicts with ruff format
236
234
" E114" , # Conflicts with ruff format
237
235
" E117" , # Conflicts with ruff format
236
+ " FA100" , # Adding from __future__ import annotations screws up cmd2 because of how use inspect to validate type annotations at runtime
238
237
" ISC002" , # Conflicts with ruff format
239
238
" Q000" , # Conflicts with ruff format
240
239
" Q001" , # Conflicts with ruff format
@@ -258,56 +257,35 @@ dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
258
257
259
258
mccabe.max-complexity = 49
260
259
261
- per-file-ignores."cmd2/__init__.py" = [
262
- " E402" , # Module level import not at top of file
263
- " F401" , # Unused import
264
- ]
260
+ [tool .ruff .lint .per-file-ignores ]
261
+ # Module level import not at top of file and unused import
262
+ "cmd2/__init__.py" = [" E402" , " F401" ]
265
263
266
- per-file-ignores."cmd2/argparse_custom.py" = [
267
- " B010" , # Do not call setattr with a constant attribute value
268
- ]
264
+ # Do not call setattr with constant attribute value
265
+ "cmd2/argparse_custom.py" = [" B010" ]
269
266
270
- per-file-ignores."examples/*.py" = [
267
+ # Ignore various varnings in examples/ directory
268
+ "examples/*.py" = [
271
269
" ANN" , # Ignore all type annotation rules in examples folder
272
270
" D" , # Ignore all pydocstyle rules in examples folder
273
271
" INP001" , # Module is part of an implicit namespace
274
272
" PLW2901" , # loop variable overwritten inside loop
275
273
" S" , # Ignore all Security rules in examples folder
276
274
]
275
+ "examples/scripts/*.py" = [" F821" ] # Undefined name `app`
276
+ "plugins/*.py" = [" INP001" ] # Module is part of an implicit namespace
277
277
278
- per-file-ignores."examples/scripts/*.py" = [
279
- " F821" , # Undefined name `app`
280
- ]
281
-
282
- per-file-ignores."plugins/*.py" = [
283
- " ANN" , # Ignore all type annotation rules in test folders
284
- " D" , # Ignore all pydocstyle rules in test folders
285
- " INP001" , # Module is part of an implicit namespace
286
- " S" , # Ignore all Security rules in test folders
287
- " SLF" , # Ignore all warnings about private or protected member access in test folders
288
- ]
289
-
290
- per-file-ignores."tests/*.py" = [
278
+ # Ingore various rulesets in test and plugins directories
279
+ "{plugins,tests,tests_isolated}/*.py" = [
291
280
" ANN" , # Ignore all type annotation rules in test folders
292
281
" ARG" , # Ignore all unused argument warnings in test folders
293
282
" D" , # Ignore all pydocstyle rules in test folders
294
283
" E501" , # Line too long
295
284
" S" , # Ignore all Security rules in test folders
296
285
" SLF" , # Ignore all warnings about private or protected member access in test folders
297
286
]
298
-
299
- per-file-ignores."tests/pyscript/*.py" = [
300
- " F821" , # Undefined name `app`
301
- " INP001" , # Module is part of an implicit namespace
302
- ]
303
-
304
- per-file-ignores."tests_isolated/*.py" = [
305
- " ANN" , # Ignore all type annotation rules in test folders
306
- " ARG" , # Ignore all unused argument warnings in test folders
307
- " D" , # Ignore all pydocstyle rules in test folders
308
- " S" , # Ignore all Security rules in test folders
309
- " SLF" , # Ignore all warnings about private or protected member access in test folders
310
- ]
287
+ # Undefined name `app` and module is part of an implicit namespace
288
+ "tests/pyscript/*.py" = [" F821" , " INP001" ]
311
289
312
290
[tool .ruff .format ]
313
291
# Like Black, use double quotes for strings.
0 commit comments