-
Notifications
You must be signed in to change notification settings - Fork 440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
current pre-commit configuration does not working on windows clients #148
Comments
But it's completely optional, you don't have to use pre-commit. It's just a help and a way for us to keep the code consistent. To be honest, it will probably be difficult to find other suitable pre-commit hooks. Most development work, except of course for Windows itself, tends to be done on Unix-like systems like MacOS or Linux. |
I understand its optional. But its hard to send in a PR without proper formattting (which i experieced) since it will be blocked. From the issue reports I understand that these issues would be hard to fix (one of them have been open for one year). I can have a look and see if I can find something that would work on windows that gives the simiar result or we should add a description on what formatting is expected before submitting a PR. I just wanted to report this if other users experience the same issues. |
I understand that. But after sending the merge request you will get a detailed log, what to adjust if necessary. And we are always ready to help with the adjustments. Just as we have already done. Of course we would appreciate it if you find pre-commit hooks with the same functionality that can run multiplatform. In any case, a good idea to record this here in case someone else encounters this problem. |
A workaround on Windows is to run git and pre-commit from WSL2 (Windows Subsystem for Linux) this approach works fine and is supported by VSCode on Windows. I suggest this is kept for information (or documented in wiki). It's ok to mark this bug as "won't fix". |
Yes, that's exactly the way I use it too.😊 |
The precommit yaml addons does not work on windows, see issues;
adrienverge/yamllint#347
jumanjihouse/pre-commit-hook-yamlfmt#25
If you want people to contribute when using Windows as a client i suggest a change of plugins for pre-commit...
These are the errors shown in vscode;
yamlint:
Traceback (most recent call last):
File "C:\users\magnu\appdata\local\programs\python\python39\lib\runpy.py", line 197, in _run_module_as_main
return run_code(code, main_globals, None,
exec(code, run_globals)
File "C:\Users\magnu.cache\pre-commit\repo49jpfjdz\py_env-python3.9\Scripts\yamllint.EXE_main.py", line 7, in
File "C:\Users\magnu.cache\pre-commit\repo49jpfjdz\py_env-python3.9\lib\site-packages\yamllint\cli.py", line 206, in run
problems = linter.run(f, conf, filepath)
File "C:\Users\magnu.cache\pre-commit\repo49jpfjdz\py_env-python3.9\lib\site-packages\yamllint\linter.py", line 240, in run
content = input.read()
File "C:\users\magnu\appdata\local\programs\python\python39\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8f in position 131: character maps to
yamlfmt
Format YAML files........................................................Failed
Executable
C:Usersmagnu.cachepre-commitrepotor08tibpy_env-python3.9Scriptspython.EXE
not foundThe text was updated successfully, but these errors were encountered: