Skip to content

Commit b18601b

Browse files
jamackukdudka
authored andcommitted
tests/csdiff: cover the line content matching by a test
... taken from a real-world example encountered by differential-shellcheck: redhat-plumbers-in-action/differential-shellcheck#376 Related: #98
1 parent ffb37e8 commit b18601b

7 files changed

+1126
-0
lines changed

tests/csdiff/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -88,5 +88,6 @@ test_csdiff(diff-misc 20-shellcheck-line-content)
8888
test_csdiff(diff-misc 21-kernel-shell-code)
8989
test_csdiff(diff-misc 22-kernel-zstream-path)
9090
test_csdiff(diff-misc 23-cov-parser-key-event)
91+
test_csdiff(diff-misc 24-shellcheck-line-content)
9192

9293
add_subdirectory(filter-file)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Error: SHELLCHECK_WARNING:
2+
src/functions.sh:309:46: warning[SC2154]: GITHUB_REF is referenced but not assigned.
3+
# 307| is_debug && local verbose=--verbose
4+
# 308|
5+
# 309|-> echo '{"commit_oid":"'"${HEAD}"'","ref":"'"${GITHUB_REF//merge/head}"'","analysis_key":"differential-shellcheck","sarif":"'"$(gzip -c output.sarif | base64 -w0)"'","tool_names":["differential-shellcheck"]}' > payload.json
6+
# 310|
7+
# 311| local curl_args=(
8+
9+
Error: SHELLCHECK_WARNING:
10+
src/functions.sh:309:129: info[SC2312]: Consider invoking this command separately to avoid masking its return value (or use '|| true' to ignore).
11+
# 307| is_debug && local verbose=--verbose
12+
# 308|
13+
# 309|-> echo '{"commit_oid":"'"${HEAD}"'","ref":"'"${GITHUB_REF//merge/head}"'","analysis_key":"differential-shellcheck","sarif":"'"$(gzip -c output.sarif | base64 -w0)"'","tool_names":["differential-shellcheck"]}' > payload.json
14+
# 310|
15+
# 311| local curl_args=(
16+
17+
Error: SHELLCHECK_WARNING:
18+
src/functions.sh:309:152: info[SC2312]: Consider invoking this command separately to avoid masking its return value (or use '|| true' to ignore).
19+
# 307| is_debug && local verbose=--verbose
20+
# 308|
21+
# 309|-> echo '{"commit_oid":"'"${HEAD}"'","ref":"'"${GITHUB_REF//merge/head}"'","analysis_key":"differential-shellcheck","sarif":"'"$(gzip -c output.sarif | base64 -w0)"'","tool_names":["differential-shellcheck"]}' > payload.json
22+
# 310|
23+
# 311| local curl_args=(
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Error: SHELLCHECK_WARNING:
2+
src/functions.sh:309:46: warning[SC2154]: GITHUB_REF is referenced but not assigned.
3+
# 307| is_debug && local verbose=--verbose
4+
# 308|
5+
# 309|-> echo '{"commit_oid":"'"${HEAD}"'","ref":"'"${GITHUB_REF//merge/head}"'","analysis_key":"differential-shellcheck","sarif":"'"$(gzip -c output.sarif | base64 -w0)"'","tool_names":["differential-shellcheck"]}' > payload.json
6+
# 310|
7+
# 311| local curl_args=(
8+
9+
Error: SHELLCHECK_WARNING:
10+
src/functions.sh:309:129: info[SC2312]: Consider invoking this command separately to avoid masking its return value (or use '|| true' to ignore).
11+
# 307| is_debug && local verbose=--verbose
12+
# 308|
13+
# 309|-> echo '{"commit_oid":"'"${HEAD}"'","ref":"'"${GITHUB_REF//merge/head}"'","analysis_key":"differential-shellcheck","sarif":"'"$(gzip -c output.sarif | base64 -w0)"'","tool_names":["differential-shellcheck"]}' > payload.json
14+
# 310|
15+
# 311| local curl_args=(
16+
17+
Error: SHELLCHECK_WARNING:
18+
src/functions.sh:309:152: info[SC2312]: Consider invoking this command separately to avoid masking its return value (or use '|| true' to ignore).
19+
# 307| is_debug && local verbose=--verbose
20+
# 308|
21+
# 309|-> echo '{"commit_oid":"'"${HEAD}"'","ref":"'"${GITHUB_REF//merge/head}"'","analysis_key":"differential-shellcheck","sarif":"'"$(gzip -c output.sarif | base64 -w0)"'","tool_names":["differential-shellcheck"]}' > payload.json
22+
# 310|
23+
# 311| local curl_args=(

tests/csdiff/diff-misc/24-shellcheck-line-content-fix-z.err

Whitespace-only changes.

tests/csdiff/diff-misc/24-shellcheck-line-content-fix.err

Whitespace-only changes.

0 commit comments

Comments
 (0)