check-executables-have-shebangs not correct on windows
See original GitHub issuedoes not seem to work right on windows
i am dealing with a primarily linux / python project but on a windows machine.
i have set git config core.filemode false
i created a new file and stage and i verify that filemode is 644:
>git ls-files -s newfile.py
100644 3edd36f71bf2081c70a0eaf39dec6980d0a9f791 0 newfile.py
but hook still fails
hookid: check-executables-have-shebangs
newfile.py: marked executable but has no (or invalid) shebang!
If it isn't supposed to be executable, try: chmod -x newfile.py
If it is supposed to be executable, double-check its shebang.
why is this file causing error?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:18 (9 by maintainers)
Top Results From Across the Web
Checks that non-binary executables have a proper shebang.
Tuto git check-executables-have-shebangs checks that non-binary executables have a proper shebang.
Read more >Should I put #! (shebang) in Python scripts, and what form ...
The shebang line in any script determines the script's ability to be executed like a standalone executable without typing python beforehand in the...
Read more >refs/tags/v4.1.0 - pre-commit-hooks - Git at Google
Checks that non-binary executables have a proper shebang. check-json. Attempts to load all json files to verify syntax. check-merge-conflict. Check for ...
Read more >Python Shebangs on Windows - assert_not magic?
So, to ensure that you're set up right, run the “Default Programs” application and make sure Python files are associated with the C:\WINDOWS\py....
Read more >Differences between Windows PowerShell 5.1 and ...
Skip null-element check for collections with a value-type element type ... and array expressions @() so that $? is not automatically true.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I bypassed the issue by running this command in my Windows Powershell.
git update-index --chmod=+x .\filename.py
so perhaps it could look at what it set in
core.filemode
if
false
that means “can’t trust os filemode”so if
false
, then look at git filemode; otherwise, os is fine?