-
Notifications
You must be signed in to change notification settings - Fork 9
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
Shown alerts should include a possible solution (if available) #88
Comments
We are aware of this issue. @lzaoral is already working on solution in: Sorry for the inconvenience. |
csutils/csdiff#68 is a different issue. [1] https://www.shellcheck.net/wiki/Integration#GCC-compatible-error-messages |
I'm currently working on getting sarif-fmt package to Fedora. It could improve the current situation once available. Example of output of sarif-fmt for ShellCheck: $ shellcheck --format=json shell.sh | shellcheck-sarif | sarif-fmt
note: Use $(...) notation instead of legacy backticks `...`.
┌─ innocent-script.sh:15:15
│
15 │ combined_file=`cat ${files}`
│ ^^^^^^^^^^^^^^
│
┌─ innocent-script.sh:15:15
│
15 │ combined_file=`cat ${files}`
│ -
│
┌─ innocent-script.sh:15:28
│
15 │ combined_file=`cat ${files}`
│ -
│
= SC2006
= For more information: https://www.shellcheck.net/wiki/SC2006
|
Show more context for ShellCheck defects and fixes in console output. Using the `csgrep --embed-context` option allows us to show a part of the code in which a defect is reported. This is much more user-friendly than the current plain GCC output format. This commit also fixes issues with statistics calculations. Related to: redhat-plumbers-in-action#88
Show more context for ShellCheck defects and fixes in console output. Using the `csgrep --embed-context` option allows us to show a part of the code in which a defect is reported. This is much more user-friendly than the current plain GCC output format. This commit also fixes issues with statistics calculations. Related to: redhat-plumbers-in-action#88
Show more context for ShellCheck defects and fixes in console output. Using the `csgrep --embed-context` option allows us to show a part of the code in which a defect is reported. This is much more user-friendly than the current plain GCC output format. This commit also fixes issues with statistics calculations. Related to: #88
Following PR should make the situation a bit better: |
Possible solution would be implementation of: |
There is an action to add suggestions based on a git diff: reviewdog/action-suggester. It already implements filtering changes related to a change set so it can be used with shellcheck directly. It modifies all the lines that are available in PR context (as diff by default shows 3 lines of context and GitHub allows commenting on those lines). I think having a write option in differential-shellcheck may be beneficial for local development when dealing with large files. It would allow applying the fixes only to the changed lines and allow using differential-shellcheck action with action-suggester. |
Type of issue
Feature Request
Description
ShellCheck provides possible solutions for reported issues in the Did you mean section, e.g.:
which the currently shown alerts don't include:
Describe the solution you'd like
Having the suggested solution as part of the alert would be great, maybe even in some diff-aware form, so the difference is clearly visible.
The text was updated successfully, but these errors were encountered: