-
Notifications
You must be signed in to change notification settings - Fork 14
Exclude specific issues during shellcheck scan (closes #22) #39
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
Closed
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
377e974
Update README.md (#45)
YueMiyuki cba41f1
Implemented shellcheck exclude feature to ignore specific issues duri…
asadmansr 304d670
Updated the exclude issues feature upon PR feedback and updated the n…
asadmansr d1402a5
Updated variable naming for exclude issues tests for readability
asadmansr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
6 changes: 6 additions & 0 deletions
6
test_data/exclude_issues/test_script_exclude_multiple_errors.sh
This file contains hidden or 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,6 @@ | ||
| #! /bin/bash | ||
|
|
||
| var=World; echo "Hello " | ||
| echo "$(date)" | ||
|
|
||
| $foo=42 |
This file contains hidden or 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 @@ | ||
| #! /bin/bash | ||
|
|
||
| echo "Hello $name" |
This file contains hidden or 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 @@ | ||
| #!/bin/sh | ||
| var = 42 | ||
| echo -n 42 |
This file contains hidden or 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,37 @@ | ||
| #! /bin/bash | ||
|
|
||
| source ./entrypoint.sh "" "" "" "" "--test" | ||
|
|
||
| test_exclude_no_error(){ | ||
| input_paths="./test_data/exclude_issues/test_script_exclude_none.sh" | ||
| severity_mode="style" | ||
| exclude_issues="" | ||
| local expected_error="SC2154" | ||
| local actual_message=$(process_input) | ||
|
|
||
| assertContains "Actual messages:$actual_message Did not find the message.\n" "$actual_message" "$expected_error" | ||
| } | ||
|
|
||
| test_exclude_one_error(){ | ||
| input_paths="./test_data/exclude_issues/test_script_exclude_one_error.sh" | ||
| severity_mode="style" | ||
| exclude_issues="SC2283" | ||
| local expected_error="SC3037" | ||
| local not_expected_error="SC2283" | ||
| local actual_message=$(process_input) | ||
|
|
||
| assertContains "Actual messages:$actual_message Did not find the message.\n" "$actual_message" "$expected_error" | ||
| assertNotContains "Actual messages:$actual_message contains the message.\n" "$actual_message" "$not_expected_error" | ||
| } | ||
|
|
||
| test_exclude_multiple_errors(){ | ||
| input_paths="./test_data/exclude_issues/test_script_exclude_multiple_errors.sh" | ||
| severity_mode="style" | ||
| exclude_issues="SC1017,SC2281,SC2034,SC2154,SC2005" | ||
| local expected_message="Successfully scanned" | ||
| local actual_message=$(process_input) | ||
|
|
||
| assertContains "Actual messages:$actual_message Did not find the message.\n" "$actual_message" "$expected_message" | ||
| } | ||
|
|
||
| source ./tests/shunit2 |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.