Skip to content
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

ci: shellcheck checks #697

Merged
merged 2 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Shellcheck
on:
pull_request:
branches:
- master
jobs:
shellcheck:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run ShellCheck
uses: ludeeus/[email protected]
env:
SHELLCHECK_OPTS: -x # allow outside sources
with:
# This code comes directly from upstream libsecp256k1
# and should not be linted here.
ignore_paths: ./secp256k1-sys/depend/**/*.sh
storopoli marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 0 additions & 4 deletions contrib/extra_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ say() {
echo "extra_tests: $1"
}

say_err() {
say "$1" >&2
}

Comment on lines -45 to -48
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not being used

verbose_say() {
if [ "$flag_verbose" = true ]; then
say "$1"
Expand Down
4 changes: 0 additions & 4 deletions contrib/sanitizer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ say() {
echo "extra_tests: $1"
}

say_err() {
say "$1" >&2
}

Comment on lines -51 to -54
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not being used

verbose_say() {
if [ "$flag_verbose" = true ]; then
say "$1"
Expand Down
6 changes: 3 additions & 3 deletions githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ if [ "$allownonascii" != "true" ] &&
# Note that the use of brackets around a tr range is ok here, (it's
# even required, for portability to Solaris 10's /usr/bin/tr), since
# the square bracket bytes happen to fall in the designated range.
test $(git diff --cached --name-only --diff-filter=A -z $against |
LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
test "$(git diff --cached --name-only --diff-filter=A -z "$against" |
LC_ALL=C tr -d '[ -~]\0' | wc -c)" != 0
then
cat <<\EOF
Error: Attempt to add a non-ASCII file name.
Expand All @@ -44,7 +44,7 @@ EOF
fi

# If there are whitespace errors, print the offending file names and fail.
git diff-index --check --cached $against -- || exit 1
git diff-index --check --cached "$against" -- || exit 1

# Check that code lints cleanly.
cargo clippy --features=rand,std,recovery,lowmemory,global-context --all-targets -- -D warnings || exit 1
Expand Down
Loading