-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from azohra/release/0.6.0
Releasing Shell Linter v0.6.0
- Loading branch information
Showing
15 changed files
with
146 additions
and
54 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
- Added support for ShellCheck severity mode | ||
- The default behavior is set to `style` which considers errors with all severity levels | ||
- Improved tagging | ||
- The latest stable version can be fetched by using `@latest` | ||
- The latest stable version can be fetched by using `@latest` |
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,3 @@ | ||
- Added support for excluding files and folders from Shellcheck scan | ||
- Upgraded the Shellcheck version used in the Shell-linter action to v0.7.2 to support the updated error/warning codes | ||
- Improved performance by adding `-x` to shellcheck to follow sourced files that are not specified as input |
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,4 @@ | ||
#! /bin/bash | ||
|
||
VERSION="v0.5.0" | ||
VERSION="v0.6.0" | ||
echo $VERSION |
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,8 @@ | ||
#! /bin/bash | ||
#!/bin/bash | ||
|
||
# Update shellcheck to the locked v0.7.0 version through the binary distribution | ||
scversion='v0.7.0' | ||
scversion='v0.7.2' | ||
|
||
wget -qO- "https://github.com/koalaman/shellcheck/releases/download/${scversion?}/shellcheck-${scversion?}.linux.x86_64.tar.xz" | tar -xJv | ||
sudo cp "shellcheck-${scversion}/shellcheck" /usr/bin/ | ||
cp "shellcheck-${scversion}/shellcheck" /usr/local/bin | ||
rm -rf "shellcheck-${scversion}" | ||
shellcheck --version |
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,5 @@ | ||
#!/bin/bash | ||
|
||
if [[ -f ./src/tagging.sh ]]; then | ||
. /src/tagging.sh | ||
fi |
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,47 @@ | ||
#! /bin/bash | ||
# shellcheck disable=SC2155 | ||
|
||
source ./entrypoint.sh "" "" "" "--test" | ||
|
||
test_ignore_directories(){ | ||
local exclude_paths="test_dir,severity_mode" | ||
local actual_message=$(process_input) | ||
local message1="Scanning example_script.sh" | ||
local message2="Scanning test_script_info.sh" | ||
local expected1="Scanning test_script_wsh.sh" | ||
|
||
assertNotContains "Actual message:$actual_message contains the message.\n" "$actual_message" "$message1" | ||
assertNotContains "Actual message:$actual_message contains the message.\n" "$actual_message" "$message2" | ||
assertContains "Actual messages:$actual_message Did not contain the expected message.\n" "$actual_message" "$expected1" | ||
} | ||
|
||
test_ignore_files(){ | ||
local input_paths="./test_data/script_type" | ||
local exclude_paths="script_type/test.zsh,script_type/test_script.js,script_type/test_zsh_wsh,script_type/test_python,script_type/test_script_wosh.sh" | ||
local actual_message=$(process_input) | ||
local expected1="Scanning sample.bash" | ||
local expected2="Scanning test_script_wsh.sh" | ||
local notExpected="ShellCheck only supports sh/bash/dash/ksh scripts. For supported scripts to be scanned, make sure to add a proper shebang on the first line of the script." | ||
|
||
assertContains "Actual messages:$actual_message Did not contain the expected message.\n" "$actual_message" "$expected1" | ||
assertContains "Actual messages:$actual_message Did not contain the expected message.\n" "$actual_message" "$expected2" | ||
assertNotContains "Actual message:$actual_message contains the message.\n" "$actual_message" "$notExpected" | ||
} | ||
|
||
test_ignore_file_and_directory(){ | ||
local exclude_paths="script_type,severity_mode,test_dir/invalid_script" | ||
local actual_message=$(process_input) | ||
local expected1="Scanning example_script.sh" | ||
local expected2="Scanning executable_script" | ||
local notExpected="ShellCheck only supports sh/bash/dash/ksh scripts. For supported scripts to be scanned, make sure to add a proper shebang on the first line of the script." | ||
|
||
assertContains "Actual messages:$actual_message Did not contain the expected message.\n" "$actual_message" "$expected1" | ||
assertContains "Actual messages:$actual_message Did not contain the expected message.\n" "$actual_message" "$expected2" | ||
assertNotContains "Actual message:$actual_message contains the message.\n" "$actual_message" "$notExpected" | ||
} | ||
|
||
tearDown(){ | ||
input_paths="" | ||
invalid_files=() | ||
} | ||
source ./tests/shunit2 |
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
Oops, something went wrong.