bazel: add Bazel shell completion scripts (#1804)

* add bazel autocomplete script

* indentation

* shfmt

* shellcheck ignore completion file

* fix shellcheck ignore path
This commit is contained in:
Moritz Sanft 2023-05-22 12:54:38 +02:00 committed by GitHub
parent dc9b3c1937
commit 339e750c18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15155 additions and 1 deletions

View file

@ -30,7 +30,11 @@ excludeDirs=(
"docs/node_modules"
)
echo "The following scripts are excluded and won't be linted with shellcheck:"
excludeFiles=(
"bazel/bazel-complete.bash"
)
echo "The following scripts are excluded by their directory and won't be linted with shellcheck:"
for exclude in "${excludeDirs[@]}"; do
for i in "${!scripts[@]}"; do
if [[ ${scripts[i]} == "${BUILD_WORKSPACE_DIRECTORY}/${exclude}"* ]]; then
@ -40,6 +44,16 @@ for exclude in "${excludeDirs[@]}"; do
done
done
echo "The following scripts are excluded and won't be linted with shellcheck:"
for exclude in "${excludeFiles[@]}"; do
for i in "${!scripts[@]}"; do
if [[ ${scripts[i]} == "${BUILD_WORKSPACE_DIRECTORY}/${exclude}" ]]; then
echo " ${scripts[i]}"
unset 'scripts[i]'
fi
done
done
echo "Linting the following scripts with shellcheck:"
for script in "${scripts[@]}"; do
echo " ${script}"