Skip to content
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

script-must-(not)-have-extension hook does report false results on Windows #68

Open
MinerSebas opened this issue Aug 19, 2020 · 0 comments

Comments

@MinerSebas
Copy link

Windows does not have a concept of executable , thus Identify which is used be pre-commit, reports all files as executable on Windows, even if git itself is aware which files are executable.
This makes the script-must-have-extension and script-must-not-have-extension hooks useless on Windows.
pre-commit themselves had the the same problem pre-commit/pre-commit-hooks#435

$ pre-commit run -a
Non-executable shell script filename ends in .sh.......(no files to check)Skipped
Executable shell script omits the filename extension.......................Failed
- hook id: script-must-not-have-extension
- exit code: 1

[ERROR] gut-copy.sh has an extension but should not
[ERROR] gut.sh has an extension but should not

$ identify-cli gut.sh
["executable", "file", "shell", "text"]

$ identify-cli gut-copy.sh
["executable", "file", "shell", "text"]

$ git ls-files -s gut.sh
100755 57765ec5365a5d2da0de57ecb31fbeee2bdbb7d4 0       gut.sh

$ git ls-files -s gut-copy.sh
100644 57765ec5365a5d2da0de57ecb31fbeee2bdbb7d4 0       gut-copy.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant