-
-
Notifications
You must be signed in to change notification settings - Fork 149
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
Non-executable shell script with shebang line should be detected as "shell" #350
Comments
@asottile I'm not sure I understand. The relevant example uses an executable file: >>> identify.tags_from_path('/path/to/file-with-shebang')
{'file', 'text', 'shell', 'bash', 'executable'} So this is an issue with the integration with pre-commit? |
nope, this is a "you stopped reading before you got to the relevant part" problem:
|
OK, so it's not working as expected. Why does it not read the shebang line of non-executables? |
Tools like IDEs and ShellCheck do read the shebang line of non-executables, after all. So does the $ file .envrc
.envrc: Bourne-Again shell script, ASCII text executable |
the point of a shebang is to indicate to the OS how to execute it -- it is only relevant when it is executable parsing shebangs of non-executables would also mean everything has to read every file always which is slow this is not up for debate so please do not waste your time and my time |
Actual behaviour:
Expected behaviour: the results should be identical for the executable and non-executable versions of the file, because the first line in the file is a valid shell script shebang line:
#!/usr/bin/env bash
.The text was updated successfully, but these errors were encountered: