Skip to content

Commit 343b81c

Browse files
committed
Rework binaries list
1 parent 0c2c900 commit 343b81c

File tree

1 file changed

+10
-27
lines changed

1 file changed

+10
-27
lines changed

bin/ci/shellcheck

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,46 +6,29 @@ readonly ROOT_DIR="$(realpath "$(dirname "$(realpath "$0")")/../..")"
66

77
source "${ROOT_DIR}"/bin/ci/dockerise.inc.bash
88

9-
readonly binaries=(
10-
bin/ci/composer-require-checker
11-
bin/ci/composer-validate
12-
bin/ci/docker
13-
bin/ci/env
14-
bin/ci/infection
15-
bin/ci/phpcs
16-
bin/ci/phpdd
17-
bin/ci/phpstan
18-
bin/ci/phpunit
19-
bin/ci/phpunit-coverage
20-
bin/ci/shellcheck
21-
bin/ci/unused-scanner
22-
bin/ci/validate
23-
bin/release/code-lines
24-
bin/release/docker
25-
bin/release/env
26-
bin/release/phpunit-coverage
27-
bin/release/prepare
28-
bin/composer
29-
bin/docker-build.inc.bash
30-
bin/dockerise.inc.bash
31-
bin/start
32-
)
9+
filesToCheck=()
10+
files=$(find "${ROOT_DIR}"/bin)
11+
for file in ${files}; do
12+
if [ -f "${file}" ] && [ "${file:(-4)}" != ".php" ]; then
13+
filesToCheck+=("${file}")
14+
fi
15+
done
3316

3417
exitCode=0
35-
for binary in "${binaries[@]}"; do
18+
for fileToCheck in "${filesToCheck[@]}"; do
3619
set +e
3720
# SC1090: Can't follow non-constant source. Use a directive to specify location.
3821
# SC2034: COMPOSER_HOME_SYMFONY appears unused. Verify use (or export if used externally).
3922
# SC2086: Double quote to prevent globbing and word splitting. (needed for ${DOCKER_INTERACTIVE_PARAMETER})
4023
# SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
41-
shellcheck --color=always --exclude SC1090,SC2034,SC2086,SC2181 "${binary}"
24+
shellcheck --color=always --exclude SC1090,SC2034,SC2086,SC2181 "${fileToCheck}"
4225
if [ ${?} != 0 ]; then
4326
exitCode=1
4427
fi
4528
set -e
4629
done
4730

4831
if [ "${exitCode}" == 0 ]; then
49-
echo -e "\e[42m All files contains valid syntax. \e[0m"
32+
echo -e "\e[42m All ${#filesToCheck[@]} files contains valid syntax. \e[0m"
5033
fi
5134
exit ${exitCode}

0 commit comments

Comments
 (0)