-
Notifications
You must be signed in to change notification settings - Fork 34
Lint rule for ensuring set -euo pipefail
or similar is set
#190
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
Comments
I would rank this as a lower priority than #191 and implementing shellcheck might provide a simple solution to this. So this should probably take a backseat until we get shellcheck incorporated. |
Shellcheck is now(long ago) merged, I can work on it @a-frantz |
@dead8309 I'm concerned this lint rule might not be achievable trivially, but I haven't investigated. I'm going to lay out some more thoughts here in this comment. from the linked comment:
To be more specific, we want this lint to fire if the I think trying to parse the above naively (i.e. checking the command text for presence/absence of pipes, multiple lines, etc) will be too fragile. I'd rather not have this lint than have one that has false negatives or false positives. That pretty much means we'll have to shell out to some existing tool for doing this check, and I'm not sure if that tool exists (I haven't looked, but I don't think this is included in shellcheck?). So, I'm going to assign this issue to you, but coming back after some research and saying "this doesn't look doable" instead of pushing a PR is an acceptable outcome! |
@a-frantz we could use It might be better if we just document it as a best practice |
@dead8309 yea I kind of expected this to lead to a dead end... that's too bad. I'm going to leave this issue open, because maybe someone finds a solution that works later!
we already do this on the workflows repo! Although I'm not sure the whole doc is super up to date. I haven't reviewed it recently. https://github.com/stjudecloud/workflows/blob/main/best-practices.md |
Upgrading discussion #60 to an issue for visibility.
Repeating myself, but I would think there's an "off the shelf" solution we can pull for this. It might involve shelling out, but I think that would be ok. I just don't want us to get in the business of writing a Bash parser 😬
The text was updated successfully, but these errors were encountered: