This repository was archived by the owner on Aug 1, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 12
This repository was archived by the owner on Aug 1, 2025. It is now read-only.
[BUG] doesn't support TOML list in per-file-ignores #160
Copy link
Copy link
Closed
Labels
Description
This pyproject.toml will blow up with pylint==3.2.6 and pylint-per-file-ignores==1.3.2:
[tool.pylint.messages_control]
per-file-ignores = [
"scripts/modal/:import-error", # Modal Image imports are a false positive
"scripts/db.py:not-callable", # not-callable is a false positive, SEE: https://github.com/pylint-dev/pylint/issues/8138
]It blows up with an error on splitting in https://github.com/christopherpickering/pylint-per-file-ignores/blob/v1.3.2/pylint_per_file_ignores/__init__.py#L252-L257:
Traceback (most recent call last):
File "/path/to/venv/bin/pylint", line 8, in <module>
sys.exit(run_pylint())
^^^^^^^^^^^^
File "/path/to/venv/lib/python3.12/site-packages/pylint/__init__.py", line 34, in run_pylint
PylintRun(argv or sys.argv[1:])
File "/path/to/venv/lib/python3.12/site-packages/pylint/lint/run.py", line 162, in __init__
args = _config_initialization(
^^^^^^^^^^^^^^^^^^^^^^^
File "/path/to/venv/lib/python3.12/site-packages/pylint/config/config_initialization.py", line 135, in _config_initialization
linter.load_plugin_configuration()
File "/path/to/venv/lib/python3.12/site-packages/pylint/lint/pylinter.py", line 407, in load_plugin_configuration
module_or_error.load_configuration(self)
File "/path/to/venv/lib/python3.12/site-packages/pylint_per_file_ignores/__init__.py", line 253, in load_configuration
linter.config.per_file_ignores = dict(
^^^^^
ValueError: dictionary update sequence element #0 has length 3; 2 is required
A workaround for not supporting TOML lists is string-ifying the per-file-ignores with DIY \n:
[tool.pylint.messages_control]
# Modal Image imports are a false positive
# not-callable is a false positive, SEE: https://github.com/pylint-dev/pylint/issues/8138
per-file-ignores = "scripts/modal/:import-error,\nscripts/db.py:not-callable"christopherpickering