Skip to content
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

scripts: suppress ShellCheck false positives #193

Closed
wants to merge 1 commit into from
Closed

Conversation

kdudka
Copy link
Member

@kdudka kdudka commented Nov 7, 2024

Detected by OpenScanHub:
https://openscanhub.fedoraproject.org/task/21451/log/csmock-3.7.1.20241107.141738.gf0a5aed.pr_187-1/scan-results.html

Error: SHELLCHECK_WARNING (CWE-456):
/usr/share/csbuild/scripts/run-scan.sh:28:26: warning[SC2209]: Use var=$(command) to assign output (or quote to assign string).
 #   26|
 #   27|   FILTER_CMD="$3"
 #   28|-> test -n "$FILTER_CMD" || FILTER_CMD=cat
 #   29|
 #   30|   BASE_ERR="$4"

Error: SHELLCHECK_WARNING:
/usr/share/csmock/scripts/run-shellcheck.sh:14:34: warning[SC2319]: This $? refers to a condition, not a command. Assign to a variable to avoid it being overwritten.
 #   12|   # how long we wait (wall-clock time) for a single shellcheck process to finish
 #   13|   test -n "$SC_TIMEOUT" || export SC_TIMEOUT=30
 #   14|-> test 0 -lt "$SC_TIMEOUT" || exit $?
 #   15|
 #   16|   # directory for shellcheck results

@kdudka kdudka requested a review from siteshwar November 7, 2024 14:17
@kdudka kdudka self-assigned this Nov 7, 2024
Detected by OpenScanHub:
https://openscanhub.fedoraproject.org/task/21451/log/csmock-3.7.1.20241107.141738.gf0a5aed.pr_187-1/scan-results.html
```
Error: SHELLCHECK_WARNING (CWE-456):
/usr/share/csbuild/scripts/run-scan.sh:28:26: warning[SC2209]: Use var=$(command) to assign output (or quote to assign string).
 #   26|
 #   27|   FILTER_CMD="$3"
 #   28|-> test -n "$FILTER_CMD" || FILTER_CMD=cat
 #   29|
 #   30|   BASE_ERR="$4"

Error: SHELLCHECK_WARNING:
/usr/share/csmock/scripts/run-shellcheck.sh:14:34: warning[SC2319]: This $? refers to a condition, not a command. Assign to a variable to avoid it being overwritten.
 #   12|   # how long we wait (wall-clock time) for a single shellcheck process to finish
 #   13|   test -n "$SC_TIMEOUT" || export SC_TIMEOUT=30
 #   14|-> test 0 -lt "$SC_TIMEOUT" || exit $?
 #   15|
 #   16|   # directory for shellcheck results
```
Closes: csutils#193
@kdudka
Copy link
Member Author

kdudka commented Nov 7, 2024

@siteshwar Thanks for review!

@kdudka kdudka closed this in 963788c Nov 7, 2024
@kdudka kdudka deleted the sc branch November 7, 2024 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants