pre-commit-hook-yamlfmt
pre-commit-hook-yamlfmt copied to clipboard
File path issue when running locally on Windows
Hi. The senior developer on my team has set up pre-commit hooks using this utility. The pre-commit succeeds in github, but when I run it locally, I get an error like this:
$ git commit -m "Line ending fix"
Trim Trailing Whitespace.................................................Passed
Fix End of Files.........................................................Passed
Check Yaml...............................................................Passed
Check JSON...........................................(no files to check)Skipped
Check Toml...........................................(no files to check)Skipped
Check for added large files..............................................Passed
Check for case conflicts.................................................Passed
Check for broken symlinks............................(no files to check)Skipped
Executable `C:UsersMSOV.cachepre-commitrepo3vt2tuwjpy_env-python3.10Scriptspython.EXE` not found
The exe files exist:
Directory of C:\Users\MSOV\.cache\pre-commit\repo3vt2tuwj\py_env-python3.10\Scripts
06.04.2022 13:54 <DIR> .
06.04.2022 13:54 <DIR> ..
06.04.2022 13:53 2 185 activate
06.04.2022 13:53 1 025 activate.bat
06.04.2022 13:53 3 062 activate.fish
06.04.2022 13:53 1 369 activate.nu
06.04.2022 13:53 1 758 activate.ps1
06.04.2022 13:53 1 193 activate_this.py
06.04.2022 13:53 510 deactivate.bat
06.04.2022 13:53 333 deactivate.nu
06.04.2022 13:53 106 904 pip-3.10.exe
06.04.2022 13:53 106 904 pip.exe
06.04.2022 13:53 106 904 pip3.10.exe
06.04.2022 13:53 106 904 pip3.exe
06.04.2022 13:53 24 pydoc.bat
06.04.2022 13:53 263 056 python.exe
06.04.2022 13:53 251 792 pythonw.exe
06.04.2022 13:53 106 891 wheel-3.10.exe
06.04.2022 13:53 106 891 wheel.exe
06.04.2022 13:53 106 891 wheel3.10.exe
06.04.2022 13:53 106 891 wheel3.exe
06.04.2022 13:54 4 450 yamlfmt
20 File(s) 1 385 937 bytes
2 Dir(s) 668 514 533 376 bytes free
but the path seems to have a problem
Hi Martin,
I have the same problem. Did you solve it?
Hi. No, I think we just disabled this particular commit hook, sorry.
Having the same issue. One possible solution might be using console_scripts instead of scripts (https://stackoverflow.com/questions/73136027/executable-scriptspython-exe-not-found-for-pre-commit-lose-slashes) I'll submit a PR.
Hey @daniela-winkler, did you create a PR for this issue and manage to fix it?
same issue here, would be great to get support for running this pre-commit hook under Windows too
+1
Still no fix?
The same issue with 0.2.1 and 0.2.3
chiming in here, fails on windows for me too. Just needs /
instead of \
:(