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
.github/workflow/reviewdog: Add shellcheck GitHub Action #105641
Conversation
Will this mark the check red if there is an error and yellow if there is a warning? Can we configure shellcheck and exclude things we definitely do not want globally? |
No, because checks checks are pass/fail/running, not really pass/error/warn.
Yes. |
Can you add a commit demonstrating where it triggers? |
How does it handle these errors?
|
I have a test PR: lukegb#1
At the moment, those are implicitly silenced for review purposes by virtue of being preexisting - if someone edits the shebang line then it'll complain, though. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love it!
How do we handle things like https://github.com/lukegb/nixpkgs/pull/1/files#annotation_652947792? This is clearly a false positive and we have lots of those. |
How does it handle Seems its the same as @SuperSandro2000 referred to
|
Yes I am. This is the big bummer about this PR because we will have a lot of those false positives and writing a comment above every single one of them is not fesable. |
If its not possible to instruct it to avoid these substitutions I think we should just stick with or convert to using shellcheck in derivations. |
I marked this as stale due to inactivity. → More info |
Not a show stopper but is there a way to only run this ci job if an actually .sh file changed? I have not checked if github provides some support in this direction. |
I marked this as stale due to inactivity. → More info |
There's been some interest in running Shellcheck as part of the review workflow on discrete .sh scripts as a review aid. In particular, this would cover stage-1-init.sh and stage-2-init.sh.
The use of reviewdog here is to parse the output of Shellcheck and, crucially, only report failures on lines modified by the PR author, which allows for this to be introduced now and for Shellcheck lint failures to gradually be driven down over time (or through a separate concerted effort).
This is run in the default
github-pr-check
mode. If we used thegithub-pr-review
mode instead then Shellcheck's suggestions would be in the form of review comments, but I don't think the tradeoff is worth it (and I don't really like the automatically generated commits that GitHub generates when you accept review comments...).cc @SuperSandro2000 @grahamc
[WIP, but deliberately not draft so codeowners see it]