forked from ava-labs/avalanchego
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshellcheck.sh
More file actions
executable file
·24 lines (20 loc) · 912 Bytes
/
shellcheck.sh
File metadata and controls
executable file
·24 lines (20 loc) · 912 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env bash
set -euo pipefail
# This script can also be used to correct the problems detected by shellcheck by invoking as follows:
#
# ./scripts/tests.shellcheck.sh -f diff | git apply
#
if ! [[ "$0" =~ scripts/shellcheck.sh ]]; then
echo "must be run from repository root"
exit 255
fi
# `find *` is the simplest way to ensure find does not include a
# leading `.` in filenames it emits. A leading `.` will prevent the
# use of `git apply` to fix reported shellcheck issues. This is
# compatible with both macos and linux (unlike the use of -printf).
# We exclude the graft/coreth and graft/subnet-evm directories to
# avoid linting files that should be run from a different location
# within the repo, as there are false positives.
#
# shellcheck disable=SC2035
find * \( -path 'graft/coreth' -o -path 'graft/subnet-evm' \) -prune -o -name '*.sh' -type f -print0 | xargs -0 shellcheck "${@}"