@@ -147,9 +147,7 @@ exclude = [
147147# Same as Black.
148148line-length = 127
149149indent-width = 4
150-
151- # Assume Python 3.13
152- target-version = " py313"
150+ target-version = " py39" # Minimum supported version of Python
153151output-format = " full"
154152
155153[tool .ruff .lint ]
@@ -235,6 +233,7 @@ ignore = [
235233 " E111" , # Conflicts with ruff format
236234 " E114" , # Conflicts with ruff format
237235 " 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
238237 " ISC002" , # Conflicts with ruff format
239238 " Q000" , # Conflicts with ruff format
240239 " Q001" , # Conflicts with ruff format
@@ -258,56 +257,35 @@ dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
258257
259258mccabe.max-complexity = 49
260259
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" ]
265263
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" ]
269266
270- per-file-ignores."examples/*.py" = [
267+ # Ignore various varnings in examples/ directory
268+ "examples/*.py" = [
271269 " ANN" , # Ignore all type annotation rules in examples folder
272270 " D" , # Ignore all pydocstyle rules in examples folder
273271 " INP001" , # Module is part of an implicit namespace
274272 " PLW2901" , # loop variable overwritten inside loop
275273 " S" , # Ignore all Security rules in examples folder
276274]
275+ "examples/scripts/*.py" = [" F821" ] # Undefined name `app`
276+ "plugins/*.py" = [" INP001" ] # Module is part of an implicit namespace
277277
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" = [
291280 " ANN" , # Ignore all type annotation rules in test folders
292281 " ARG" , # Ignore all unused argument warnings in test folders
293282 " D" , # Ignore all pydocstyle rules in test folders
294283 " E501" , # Line too long
295284 " S" , # Ignore all Security rules in test folders
296285 " SLF" , # Ignore all warnings about private or protected member access in test folders
297286]
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" ]
311289
312290[tool .ruff .format ]
313291# Like Black, use double quotes for strings.
0 commit comments