Describe the bug I'm trying to use the prospector 1.8.3 via pre-commit hook, but some non-linting-related pylint error appears (if I run prospector manually without pre-commit - everything works as expected)
Call prospector the following way pre-commit run --all-files
Output:
isort (python)...........................................................Passed
black....................................................................Passed
prospector...............................................................Failed
- hook id: prospector
- exit code: 1
Messages
========
.
Line: None
pylint: failure / Tool pylint failed to run (exception was raised, re-run prospector with -X to see the stacktrace)
inference/algorithm/supply.py
Line: 347
pycodestyle: E501 / line too long (286 > 120 characters) (col 121)
After adding -X to prospector params (as the error message suggests) I receive this:
Error message with -X passed
```
pre-commit run --all-files
isort (python)...........................................................Passed
black....................................................................Passed
prospector...............................................................Failed
- hook id: prospector
- exit code: 1
Traceback (most recent call last):
File "/Users/user/.cache/pre-commit/repod28udnss/py_env-python3.8/lib/python3.8/site-packages/prospector/run.py", line 87, in execute
messages += tool.run(found_files)
File "/Users/user/.cache/pre-commit/repod28udnss/py_env-python3.8/lib/python3.8/site-packages/prospector/tools/pylint/__init__.py", line 239, in run
self._linter.check(self._args)
File "/Users/user/.cache/pre-commit/repod28udnss/py_env-python3.8/lib/python3.8/site-packages/pylint/lint/pylinter.py", line 696, in check
ast_per_fileitem = self._get_asts(fileitems, data)
File "/Users/user/.cache/pre-commit/repod28udnss/py_env-python3.8/lib/python3.8/site-packages/pylint/lint/pylinter.py", line 707, in _get_asts
for fileitem in fileitems:
File "/Users/user/.cache/pre-commit/repod28udnss/py_env-python3.8/lib/python3.8/site-packages/pylint/lint/pylinter.py", line 874, in _iterate_file_descrs
for descr in self._expand_files(files_or_modules).values():
File "/Users/user/.cache/pre-commit/repod28udnss/py_env-python3.8/lib/python3.8/site-packages/prospector/tools/pylint/linter.py", line 36, in _expand_files
if not self._files.is_excluded(Path(module["path"])):
TypeError: string indices must be integers
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/user/.cache/pre-commit/repod28udnss/py_env-python3.8/bin/prospector", line 8, in
sys.exit(main())
File "/Users/user/.cache/pre-commit/repod28udnss/py_env-python3.8/lib/python3.8/site-packages/prospector/run.py", line 199, in main
prospector.execute()
File "/Users/user/.cache/pre-commit/repod28udnss/py_env-python3.8/lib/python3.8/site-packages/prospector/run.py", line 105, in execute
raise FatalProspectorException(f"Tool {toolname} failed to run.") from ex
prospector.exceptions.FatalProspectorException: Tool pylint failed to run.
```
Expected behavior I expect prospector to run and warn only about linting-related issues
Environment (please complete the following information):
Describe the bug I'm trying to use the prospector 1.8.3 via pre-commit hook, but some non-linting-related
pylint
error appears (if I run prospector manually without pre-commit - everything works as expected)To Reproduce Steps to reproduce the behavior:
.prospector.yaml
.pre-commit-config.yaml
Call prospector the following way
pre-commit run --all-files
Output:After adding
-X
to prospector params (as the error message suggests) I receive this:Error message with -X passed
``` pre-commit run --all-files isort (python)...........................................................Passed black....................................................................Passed prospector...............................................................Failed - hook id: prospector - exit code: 1 Traceback (most recent call last): File "/Users/user/.cache/pre-commit/repod28udnss/py_env-python3.8/lib/python3.8/site-packages/prospector/run.py", line 87, in execute messages += tool.run(found_files) File "/Users/user/.cache/pre-commit/repod28udnss/py_env-python3.8/lib/python3.8/site-packages/prospector/tools/pylint/__init__.py", line 239, in run self._linter.check(self._args) File "/Users/user/.cache/pre-commit/repod28udnss/py_env-python3.8/lib/python3.8/site-packages/pylint/lint/pylinter.py", line 696, in check ast_per_fileitem = self._get_asts(fileitems, data) File "/Users/user/.cache/pre-commit/repod28udnss/py_env-python3.8/lib/python3.8/site-packages/pylint/lint/pylinter.py", line 707, in _get_asts for fileitem in fileitems: File "/Users/user/.cache/pre-commit/repod28udnss/py_env-python3.8/lib/python3.8/site-packages/pylint/lint/pylinter.py", line 874, in _iterate_file_descrs for descr in self._expand_files(files_or_modules).values(): File "/Users/user/.cache/pre-commit/repod28udnss/py_env-python3.8/lib/python3.8/site-packages/prospector/tools/pylint/linter.py", line 36, in _expand_files if not self._files.is_excluded(Path(module["path"])): TypeError: string indices must be integers The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/Users/user/.cache/pre-commit/repod28udnss/py_env-python3.8/bin/prospector", line 8, inExpected behavior I expect prospector to run and warn only about linting-related issues
Environment (please complete the following information):
Additional context pre-commit 3.0.2