Skip to content

ci: shellcheck checks #689

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

Merged
merged 1 commit into from
May 20, 2024
Merged
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
16 changes: 16 additions & 0 deletions .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

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/action-shellcheck@2.0.0
env:
SHELLCHECK_OPTS: -x # allow outside sources
2 changes: 2 additions & 0 deletions embedded/scripts/env.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# we don't want shebangs in env.sh, disable shellcheck warning
# shellcheck disable=SC2148
export RUSTFLAGS="-C link-arg=-Tlink.x"
export CARGO_TARGET_THUMBV7M_NONE_EABI_RUNNER="qemu-system-arm -cpu cortex-m3 -machine mps2-an385 -nographic -semihosting-config enable=on,target=native -kernel"
3 changes: 2 additions & 1 deletion fuzz/cycle.sh
Original file line number Diff line number Diff line change
@@ -7,7 +7,8 @@

set -e
REPO_DIR=$(git rev-parse --show-toplevel)
# shellcheck source=./fuzz-util.sh
# can't find the file because of the ENV var
# shellcheck source=/dev/null
Comment on lines +10 to +11
Copy link
Member

Choose a reason for hiding this comment

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

Why do you silence this like this man instead of?

# shellcheck disable=SC1090

(I hit the same warning working on rust-bitcoin/rust-secp256k1#699.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was the same approach I did in the original rust-bitcoin PR and this is the way to adopt a Exception per the shellcheck wiki: https://www.shellcheck.net/wiki/SC1090

Copy link
Member

Choose a reason for hiding this comment

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

No worries, cheers.

source "$REPO_DIR/fuzz/fuzz-util.sh"

while :
3 changes: 2 additions & 1 deletion fuzz/fuzz.sh
Original file line number Diff line number Diff line change
@@ -3,7 +3,8 @@ set -ex

REPO_DIR=$(git rev-parse --show-toplevel)

# shellcheck source=./fuzz-util.sh
# can't find the file because of the ENV var
# shellcheck source=/dev/null
source "$REPO_DIR/fuzz/fuzz-util.sh"

# Check that input files are correct Windows file names
3 changes: 2 additions & 1 deletion fuzz/generate-files.sh
Original file line number Diff line number Diff line change
@@ -4,7 +4,8 @@ set -e

REPO_DIR=$(git rev-parse --show-toplevel)

# shellcheck source=./fuzz-util.sh
# can't find the file because of the ENV var
# shellcheck source=/dev/null
source "$REPO_DIR/fuzz/fuzz-util.sh"

# 1. Generate fuzz/Cargo.toml