-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix shellcheck CI job, fix/handle all shellcheck findings (#620)
* Fix shellcheck linting Signed-off-by: Daniel Bast <[email protected]> * Fix/handle all shellcheck findings Signed-off-by: Daniel Bast <[email protected]> * Incorporate review findings Signed-off-by: Daniel Bast <[email protected]> * Switch to pre-commit Signed-off-by: Daniel Bast <[email protected]> --------- Signed-off-by: Daniel Bast <[email protected]>
- Loading branch information
Showing
20 changed files
with
91 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,13 +9,23 @@ jobs: | |
- run: GOBIN=$HOME/.bin go install 'github.com/tilt-dev/[email protected]' | ||
- run: $HOME/.bin/tilt-extensions-ci . | ||
|
||
shellcheck: | ||
pre-commit: | ||
docker: | ||
- image: docker/tilt-extensions-ci@sha256:70127b822dc42d45480dc6cddd97297d7b454503aa75b053728b565533233989 | ||
- image: python:3.11.10-bookworm@sha256:5e5ef24d131e78708b5947823f2830ab42328132b6caff002bf6481d64b99593 | ||
|
||
steps: | ||
- checkout | ||
- run: make shellcheck | ||
- run: | | ||
python -m pip install pre-commit | ||
cp .pre-commit-config.yaml pre-commit-cache-key.txt | ||
python --version >> pre-commit-cache-key.txt | ||
- restore_cache: | ||
key: pre-commit-3-{{ checksum "pre-commit-cache-key.txt" }} | ||
- run: make pre-commit | ||
- save_cache: | ||
key: pre-commit-3-{{ checksum "pre-commit-cache-key.txt" }} | ||
paths: | ||
- ~/.cache/pre-commit | ||
|
||
test: | ||
# A common error is to build an extension that doesn't properly handle | ||
|
@@ -39,5 +49,5 @@ workflows: | |
build: | ||
jobs: | ||
- validate | ||
- shellcheck | ||
- pre-commit | ||
- test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Update this file via: | ||
# pre-commit autoupdate | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v5.0.0 | ||
hooks: | ||
- id: check-yaml | ||
args: [--allow-multiple-documents] | ||
exclude: ^.*templates.*$ | ||
- id: check-executables-have-shebangs | ||
- id: check-shebang-scripts-are-executable | ||
- repo: https://github.com/shellcheck-py/shellcheck-py | ||
rev: v0.10.0.1 | ||
hooks: | ||
- id: shellcheck | ||
- repo: https://github.com/python-jsonschema/check-jsonschema | ||
rev: 0.30.0 | ||
hooks: | ||
- id: check-circle-ci | ||
- repo: meta | ||
hooks: | ||
- id: check-hooks-apply | ||
- id: check-useless-excludes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
.PHONY: test publish-ci-image | ||
SHELL := /bin/bash -o pipefail -o errexit | ||
|
||
test: | ||
./test.sh | ||
|
||
publish-ci-image: | ||
docker buildx build --push --pull --platform linux/amd64 -t docker/tilt-extensions-ci -f .circleci/Dockerfile .circleci | ||
|
||
shellcheck: | ||
find . -type f -name '*.sh' -not -path "*/node_modules/*" -not -path "*/.git-sources/*" -not -path "*/.git/*" -exec \ | ||
docker run --rm -it -e SHELLCHECK_OPTS="-e SC2001" -v $$(pwd):/mnt nlknguyen/alpine-shellcheck {} \; | ||
pre-commit: | ||
pre-commit run --verbose --show-diff-on-failure --color=always --all-files | ||
|
||
.PHONY: $(MAKECMDGOALS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters