-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add tests for shellcheck lints
- Loading branch information
1 parent
c9ef694
commit 8474ebd
Showing
8 changed files
with
456 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
note[CommandSectionShellCheck]: `shellcheck` reported the following diagnostic | ||
┌─ tests/lints/shellcheck-error/source.wdl:18:10 | ||
│ | ||
18 │ if [ -f "$broken"] | ||
│ ^ SC1073[error]: Couldn't parse this test expression. Fix to allow more checks. | ||
│ | ||
= fix: address the diagnostics as recommended in the message | ||
|
||
note[CommandSectionShellCheck]: `shellcheck` reported the following diagnostic | ||
┌─ tests/lints/shellcheck-error/source.wdl:18:15 | ||
│ | ||
18 │ if [ -f "$broken"] | ||
│ ^ SC1019[error]: Expected this to be an argument to the unary condition. | ||
│ | ||
= fix: address the diagnostics as recommended in the message | ||
|
||
note[CommandSectionShellCheck]: `shellcheck` reported the following diagnostic | ||
┌─ tests/lints/shellcheck-error/source.wdl:18:25 | ||
│ | ||
18 │ if [ -f "$broken"] | ||
│ ^ SC1020[error]: You need a space before the ]. | ||
│ | ||
= fix: address the diagnostics as recommended in the message | ||
|
||
note[CommandSectionShellCheck]: `shellcheck` reported the following diagnostic | ||
┌─ tests/lints/shellcheck-error/source.wdl:37:10 | ||
│ | ||
37 │ if [ -f "$broken"] | ||
│ ^ SC1073[error]: Couldn't parse this test expression. Fix to allow more checks. | ||
│ | ||
= fix: address the diagnostics as recommended in the message | ||
|
||
note[CommandSectionShellCheck]: `shellcheck` reported the following diagnostic | ||
┌─ tests/lints/shellcheck-error/source.wdl:37:15 | ||
│ | ||
37 │ if [ -f "$broken"] | ||
│ ^ SC1019[error]: Expected this to be an argument to the unary condition. | ||
│ | ||
= fix: address the diagnostics as recommended in the message | ||
|
||
note[CommandSectionShellCheck]: `shellcheck` reported the following diagnostic | ||
┌─ tests/lints/shellcheck-error/source.wdl:37:25 | ||
│ | ||
37 │ if [ -f "$broken"] | ||
│ ^ SC1020[error]: You need a space before the ]. | ||
│ | ||
= fix: address the diagnostics as recommended in the message | ||
|
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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#@ except: DescriptionMissing, RuntimeSectionKeys, MatchingParameterMeta, NoCurlyCommands | ||
## This is a test of having shellcheck error lints | ||
version 1.1 | ||
|
||
task test1 { | ||
meta {} | ||
|
||
parameter_meta {} | ||
|
||
input { | ||
Int placeholder | ||
} | ||
|
||
command <<< | ||
somecommand.py [[ -f $broken_test]] | ||
if [ -f "$broken"] | ||
>>> | ||
|
||
output {} | ||
|
||
runtime {} | ||
} | ||
|
||
task test2 { | ||
meta {} | ||
|
||
parameter_meta {} | ||
|
||
input { | ||
Int placeholder | ||
} | ||
|
||
command { | ||
somecommand.py [[ -f $broken_test]] | ||
if [ -f "$broken"] | ||
} | ||
|
||
output {} | ||
|
||
runtime {} | ||
} |
Empty file.
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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#@ except: DescriptionMissing, RuntimeSectionKeys, MatchingParameterMeta, NoCurlyCommands | ||
## This is a test of having no shellcheck lints | ||
version 1.1 | ||
|
||
task test1 { | ||
meta {} | ||
|
||
parameter_meta {} | ||
|
||
input { | ||
Boolean i_quote_my_shellvars | ||
Int placeholder | ||
} | ||
|
||
command <<< | ||
set -eo pipefail | ||
|
||
echo "$placeholder" | ||
|
||
if [[ "$i_quote_my_shellvars" ]]; then | ||
echo "shellcheck will be happy" | ||
fi | ||
>>> | ||
|
||
output {} | ||
|
||
runtime {} | ||
} | ||
|
||
task test2 { | ||
meta {} | ||
|
||
parameter_meta {} | ||
|
||
input { | ||
Int placeholder | ||
} | ||
|
||
command { | ||
set -eo pipefail | ||
|
||
echo "$placeholder" | ||
|
||
if [[ "$I_quote_my_shellvars" ]]; then | ||
echo "all is well" | ||
fi | ||
} | ||
|
||
output {} | ||
|
||
runtime {} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
note[CommandSectionShellCheck]: `shellcheck` reported the following diagnostic | ||
┌─ tests/lints/shellcheck-style/source.wdl:17:7 | ||
│ | ||
17 │ [[ ]] | ||
│ ^^^ SC2212[style]: Use 'false' instead of empty [/[[ conditionals. | ||
│ | ||
= fix: address the diagnostics as recommended in the message | ||
|
||
note[CommandSectionShellCheck]: `shellcheck` reported the following diagnostic | ||
┌─ tests/lints/shellcheck-style/source.wdl:18:9 | ||
│ | ||
18 │ [ true ] | ||
│ ^^^^ SC2160[style]: Instead of '[ true ]', just use 'true'. | ||
│ | ||
= fix: address the diagnostics as recommended in the message | ||
|
||
note[CommandSectionShellCheck]: `shellcheck` reported the following diagnostic | ||
┌─ tests/lints/shellcheck-style/source.wdl:36:7 | ||
│ | ||
36 │ [[ ]] | ||
│ ^^^ SC2212[style]: Use 'false' instead of empty [/[[ conditionals. | ||
│ | ||
= fix: address the diagnostics as recommended in the message | ||
|
||
note[CommandSectionShellCheck]: `shellcheck` reported the following diagnostic | ||
┌─ tests/lints/shellcheck-style/source.wdl:37:9 | ||
│ | ||
37 │ [ true ] | ||
│ ^^^^ SC2160[style]: Instead of '[ true ]', just use 'true'. | ||
│ | ||
= fix: address the diagnostics as recommended in the message | ||
|
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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#@ except: DescriptionMissing, RuntimeSectionKeys, MatchingParameterMeta, NoCurlyCommands | ||
## This is a test of having shellcheck style lints | ||
version 1.1 | ||
|
||
task test1 { | ||
meta {} | ||
|
||
parameter_meta {} | ||
|
||
input { | ||
Int placeholder | ||
} | ||
|
||
command <<< | ||
[[ ]] | ||
[ true ] | ||
>>> | ||
|
||
output {} | ||
|
||
runtime {} | ||
} | ||
|
||
task test2 { | ||
meta {} | ||
|
||
parameter_meta {} | ||
|
||
input { | ||
Int placeholder | ||
} | ||
|
||
command { | ||
[[ ]] | ||
[ true ] | ||
} | ||
|
||
output {} | ||
|
||
runtime {} | ||
} |
Oops, something went wrong.