-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: improve console output by using
csgrep -U
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
- Loading branch information
Showing
26 changed files
with
845 additions
and
229 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,34 @@ | ||
Error: SHELLCHECK_WARNING: | ||
src/index.sh:53:10: warning[SC2154]: MAIN_HEADING is referenced but not assigned. | ||
|
||
Error: SHELLCHECK_WARNING: | ||
src/index.sh:56:14: warning[SC2154]: WHITE is referenced but not assigned. | ||
|
||
Error: SHELLCHECK_WARNING: | ||
src/index.sh:56:56: warning[SC2154]: NOCOLOR is referenced but not assigned. | ||
{ | ||
"defects": [ | ||
{ | ||
"checker": "SHELLCHECK_WARNING", | ||
"language": "shell", | ||
"tool": "shellcheck", | ||
"key_event_idx": 0, | ||
"events": [ | ||
{ | ||
"file_name": "innocent-script.sh", | ||
"line": 7, | ||
"event": "warning[SC2034]", | ||
"message": "UNUSED_VAR2 appears unused. Verify use (or export if used externally).", | ||
"verbosity_level": 0 | ||
} | ||
] | ||
}, | ||
{ | ||
"checker": "SHELLCHECK_WARNING", | ||
"language": "shell", | ||
"tool": "shellcheck", | ||
"key_event_idx": 0, | ||
"events": [ | ||
{ | ||
"file_name": "innocent-script.sh", | ||
"line": 11, | ||
"event": "warning[SC2115]", | ||
"message": "Use \"${var:?}\" to ensure this never expands to / .", | ||
"verbosity_level": 0 | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,19 @@ | ||
Error: SHELLCHECK_WARNING: | ||
src/index.sh:7:3: note[SC1091]: Not following: functions.sh: openBinaryFile: does not exist (No such file or directory) | ||
{ | ||
"defects": [ | ||
{ | ||
"checker": "SHELLCHECK_WARNING", | ||
"language": "shell", | ||
"tool": "shellcheck", | ||
"key_event_idx": 0, | ||
"events": [ | ||
{ | ||
"file_name": "innocent-script.sh", | ||
"line": 6, | ||
"event": "warning[SC2034]", | ||
"message": "UNUSED_VAR appears unused. Verify use (or export if used externally).", | ||
"verbosity_level": 0 | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,34 @@ | ||
Error: SHELLCHECK_WARNING: | ||
src/index.sh:53:10: warning[SC2154]: MAIN_HEADING is referenced but not assigned. | ||
|
||
Error: SHELLCHECK_WARNING: | ||
src/index.sh:56:14: warning[SC2154]: WHITE is referenced but not assigned. | ||
|
||
Error: SHELLCHECK_WARNING: | ||
src/index.sh:56:56: warning[SC2154]: NOCOLOR is referenced but not assigned. | ||
{ | ||
"defects": [ | ||
{ | ||
"checker": "SHELLCHECK_WARNING", | ||
"language": "shell", | ||
"tool": "shellcheck", | ||
"key_event_idx": 0, | ||
"events": [ | ||
{ | ||
"file_name": "innocent-script.sh", | ||
"line": 7, | ||
"event": "warning[SC2034]", | ||
"message": "UNUSED_VAR2 appears unused. Verify use (or export if used externally).", | ||
"verbosity_level": 0 | ||
} | ||
] | ||
}, | ||
{ | ||
"checker": "SHELLCHECK_WARNING", | ||
"language": "shell", | ||
"tool": "shellcheck", | ||
"key_event_idx": 0, | ||
"events": [ | ||
{ | ||
"file_name": "innocent-script.sh", | ||
"line": 11, | ||
"event": "warning[SC2115]", | ||
"message": "Use \"${var:?}\" to ensure this never expands to / .", | ||
"verbosity_level": 0 | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,15 @@ | ||
src/index.sh:7:3: note: Not following: functions.sh: openBinaryFile: does not exist (No such file or directory) [SC1091] | ||
src/index.sh:39:42: warning: BASE is referenced but not assigned. [SC2154] | ||
src/index.sh:39:53: warning: HEAD is referenced but not assigned. [SC2154] | ||
src/index.sh:50:10: warning: VERSIONS_HEADING is referenced but not assigned. [SC2154] | ||
{ | ||
"comments": [ | ||
{ | ||
"file": "innocent-script.sh", | ||
"line": 6, | ||
"endLine": 6, | ||
"column": 1, | ||
"endColumn": 11, | ||
"level": "warning", | ||
"code": 2034, | ||
"message": "UNUSED_VAR appears unused. Verify use (or export if used externally).", | ||
"fix": null | ||
} | ||
] | ||
} |
Oops, something went wrong.