You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Shellcheck does not allow for shebangs with a space #47
Not in this repo maybe, but if I try to use this hook in a repo it will not work unless removing the space.
I tried to test by changing the regex and validating on regexr but I'm not sure which format of regex that is (PCRE?)
Activity
brikis98 commentedon Dec 17, 2020
Do we have a script with a space after the shebang somewhere?
thibmaek commentedon Dec 17, 2020
Not in this repo maybe, but if I try to use this hook in a repo it will not work unless removing the space.
I tried to test by changing the regex and validating on regexr but I'm not sure which format of regex that is (PCRE?)
brikis98 commentedon Dec 18, 2020
Ohhh, I think I misunderstood. What you're saying is that the regex we use to identify shell scripts is what would need to be fixed?
thibmaek commentedon Dec 21, 2020
Yep indeed, the regex needs to option to allow a space between right after the bang symbol:
#!/usr/bin/env bash#! /usr/bin/env bashbrikis98 commentedon Jan 6, 2021
Understood! And, indeed, spaces after shebang are allowed, as you mentioned. Would you be up for a PR to tweak the regex?
thibmaek commentedon Jan 6, 2021
Yeah sure, do you know what format the regex is? I tried it on regexr but it didn't validate. Maybe its perl regex?
brikis98 commentedon Jan 7, 2021
It's grep format: https://stackoverflow.com/a/4192817/483528.