-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
ci(lint): add shell linter - Differential ShellCheck #8731
Conversation
This PR does not follow rule 0. from https://github.com/DefectDojo/django-DefectDojo/blob/master/readme-docs/CONTRIBUTING.md#submitting-pull-requests
Looks like somebody is injecting own tool to many open-source projects. It is not bad but I would like to be sure about real benefit. Can you provide an example of findings in this repo by your tool? |
I have changed the target branch to
"Injecting" it sounds really negative to me :-) I have no bad intentions. I want to raise awareness of static analysis of shell scripts. But feel free to reject this PR if you don't like it. Here is the list of defects:
Most of them seem to be false positives or minor issues. Having a static analysis of shell scripts might help you with the review when changing the shell scripts in the future. |
@jamacku, sorry for this "negative narrative" :) Based on the output of the tool, I see it makes sense. You even identified a real bug (from the processing of I like it. |
@kiblik I didn't take any offense. Feel free to ask anything. I'm happy to provide more examples. |
If PR will be merged. Will we see new PRs offer fixes/warnings/errors only on files which have been changed in the PR? |
When running on PR, Differential ShellCheck will report only defects caused by changes in the PR. Once/If this PR is merged, you will see all current defects with severity warning and higher in the Security tab under Code Scanning. Example of a single defect |
This action is super cool and would provide value to DefectDojo. @mtesauro how do you feel about it? |
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
Sorry, I have just accidentally committed some junk. It should now be clean. |
There was some hoakey issues with the unit tests for a minute. Please pull the latest dev branch with the updated changes |
It performs differential ShellCheck scans and reports results directly on GitHub. documentation: https://github.com/redhat-plumbers-in-action/differential-shellcheck Signed-off-by: Jan Macku <[email protected]>
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.
Approved
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.
We're going to implement ShellCheck slightly differently than is in the PR but appreciate you bringing it to our attention.
fetch-depth: 0 | ||
|
||
- name: Differential ShellCheck | ||
uses: redhat-plumbers-in-action/differential-shellcheck@v4 |
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.
Thanks for the contribution but I think we're going to utilize a different source to run shellcheck
Differential ShellCheck is a GitHub action that performs differential ShellCheck scans on shell scripts changed via PR and reports results directly in PR.
I saw that your scripts are in great shape, but I think that you might find the
differential-shellcheck
action useful. It is able to produce reports in SARIF format. GitHub understands this format and is able to display it nicely as a PR comment, and on theFiles Changed
tab, please see below.Documentation is available at @redhat-plumbers-in-action/differential-shellcheck. Let me know If you are missing some feature or setting. I'm always happy to extend functionality.