Hello,
I have recently update pre-commit from 4.2.0 to 4.3.0. I use it with ansible-lint in this way:
- repo: https://github.com/ansible/ansible-lint
rev: v25.1.0
hooks:
- id: ansible-lint
additional_dependencies:
- ansible>=9.8.0,<10.0.0
- ansible-compat==24.10.0
With pre-commit 4.2.0 is all fine. With pre-commit 4.3.0 I see
Ansible-lint.............................................................Failed
- hook id: ansible-lint
- exit code: 1
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/root/.cache/pre-commit/repozusqqq7n/py_env-python3.12/lib/python3.12/site-packages/ansiblelint/__main__.py", line 50, in <module>
from ansiblelint import cli
File "/root/.cache/pre-commit/repozusqqq7n/py_env-python3.12/lib/python3.12/site-packages/ansiblelint/cli.py", line 13, in <module>
from ansiblelint.config import (
File "/root/.cache/pre-commit/repozusqqq7n/py_env-python3.12/lib/python3.12/site-packages/ansiblelint/config.py", line 118, in <module>
PROFILES = yaml_from_file(Path(__file__).parent / "data" / "profiles.yml")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pre-commit/repozusqqq7n/py_env-python3.12/lib/python3.12/site-packages/ansiblelint/loaders.py", line 40, in yaml_from_file
with open(str(filepath), encoding="utf-8") as content:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/root/.cache/pre-commit/repozusqqq7n/py_env-python3.12/lib/python3.12/site-packages/ansiblelint/data/profiles.yml'
Do you know how to fix this?
I tried to open an issue on pre-commit, but if I understand well they say that this is not supported.
Thank you
Kind Regards
Marco