-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Copy the `shellcheck.sh` script from the SecureDrop server repository and add it to the central `make lint` target. I added SC2164 as a global exclusion since we don't really care about `cd` potentially failing. The following fixes are being made: * client/.githooks/pre-commit: Use $() instead of backticks. * debian/setup-venv.sh: Ignore quoting words, all the variables are a single word only. * proxy/entrypoint.sh: Adjust shebang since we use bashisms. * scripts/build-debs.sh: Set variable and then export it * scripts/fixup-changelog.sh: Quote our variables, don't use `! -z`. Fixes #814.
- Loading branch information
Showing
10 changed files
with
66 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/sh | ||
TOP=`git rev-parse --show-toplevel` | ||
TOP=$(git rev-parse --show-toplevel) | ||
|
||
make -C "$TOP" check-strings |
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,5 @@ | ||
#!/bin/bash | ||
# shellcheck disable=SC2086 | ||
set -euxo pipefail | ||
|
||
NAME=$1 | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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/sh | ||
#!/bin/bash | ||
|
||
cd /home/user/projects/securedrop-proxy | ||
virtualenv .venv | ||
|
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
EXCLUDE_RULES="SC1090,SC1091,SC2001,SC2064,SC2181,SC1117,SC2164" | ||
|
||
# Omitting: | ||
# - the `.git/` directory since its hooks won't pass # validation, and | ||
# we don't maintain those scripts. | ||
# - the `.venv/` dir because we don't control files in there. | ||
# - ossec packages because there are a LOT of violations, and we have | ||
# a separate issue dedicated to cleaning those up. | ||
# - Python, JavaScript, YAML, HTML, SASS, PNG files because they're not shell scripts. | ||
# - Cache directories of mypy, SASS, or Tox. | ||
# - test results | ||
FILES=$(find "." \ | ||
\( \ | ||
-path '*.mo' \ | ||
-o -path '*.po' \ | ||
-o -path '*.py' \ | ||
-o -path '*.yml' \ | ||
-o -path '*/.mypy_cache/*' \ | ||
-o -path '*/.tox/*' \ | ||
-o -path '*/.venv' \ | ||
-o -path './.git' \ | ||
-o -path './build/*' \ | ||
-o -path './target' \ | ||
\) -prune \ | ||
-o -type f \ | ||
-exec file --mime {} + \ | ||
| awk '$2 ~ /x-shellscript/ { print $1 }' \ | ||
| sed 's/://') | ||
# Turn the multiline find output into a single space-separated line | ||
FILES=$(echo "$FILES" | tr '\n' ' ') | ||
|
||
shellcheck --version | ||
# $FILES intentionally unquoted so each file is passed as its own argument | ||
# shellcheck disable=SC2086 | ||
shellcheck -x --exclude="$EXCLUDE_RULES" $FILES |