Skip to content

Commit 7f0a47f

Browse files
committed
Enabled ruff INP ruleset for warning about modules in an implicit namespace
Exempted some stuff in examples/, plugins/, and tests/
1 parent 27d1ed9 commit 7f0a47f

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

pyproject.toml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,10 @@ select = [
185185
"G", # flake8-logging-format (warn about logging statements using outdated string formatting methods)
186186
"I", # isort (sort all import statements in the order established by isort)
187187
"ICN", # flake8-import-conventions (force idiomatic import conventions for certain modules typically imported as something else)
188-
# "INP", # flake8-no-pep420 (warn about files in the implicit namespace - i.e. force creation of __init__.py files to make packages)
189-
"INT", # flake8-gettext (warnings that only apply when you are internationalizing your strings)
190-
"ISC", # flake8-implicit-str-concat (warnings related to implicit vs explicit string concatenation)
191-
"LOG", # flake8-logging (warn about potential logger issues, but very pedantic)
188+
"INP", # flake8-no-pep420 (warn about files in the implicit namespace - i.e. force creation of __init__.py files to make packages)
189+
"INT", # flake8-gettext (warnings that only apply when you are internationalizing your strings)
190+
"ISC", # flake8-implicit-str-concat (warnings related to implicit vs explicit string concatenation)
191+
"LOG", # flake8-logging (warn about potential logger issues, but very pedantic)
192192
# "N", # pep8-naming (force idiomatic naming for classes, functions/methods, and variables/arguments)
193193
"NPY", # NumPy specific rules
194194
"PD", # pandas-vet (Pandas specific rules)
@@ -254,6 +254,10 @@ per-file-ignores."cmd2/__init__.py" = [
254254
"F401", # Unused import
255255
]
256256

257+
per-file-ignores."examples/*.py" = [
258+
"INP001", # Module is part of an implicit namespace
259+
]
260+
257261
per-file-ignores."examples/override_parser.py" = [
258262
"E402", # Module level import not at top of file
259263
]
@@ -266,10 +270,23 @@ per-file-ignores."examples/unicode_commands.py" = [
266270
"PLC2401", # non-ASCII characters in function names
267271
]
268272

273+
per-file-ignores."plugins/ext_test/*.py" = [
274+
"INP001", # Module is part of an implicit namespace
275+
]
276+
277+
per-file-ignores."plugins/template/*.py" = [
278+
"INP001", # Module is part of an implicit namespace
279+
]
280+
269281
per-file-ignores."tests/pyscript/*.py" = [
270282
"F821", # Undefined name `app`
271283
]
272284

285+
per-file-ignores."tests/pyscript/raises_exception.py" = [
286+
"INP001", # Module is part of an implicit namespace
287+
]
288+
289+
273290
[tool.ruff.format]
274291
# Like Black, use double quotes for strings.
275292
quote-style = "preserve"

0 commit comments

Comments
 (0)