Use alternate self-sufficient shellcheck precommit
This pre-commit does not require prerequisite on the host, making it easier to run in CI workflows.lean/pre-commit-hook-2
parent
5616a4a3ee
commit
21aba10e08
|
@ -77,7 +77,6 @@ ci-authorized:
|
||||||
include:
|
include:
|
||||||
- .gitlab-ci/build.yml
|
- .gitlab-ci/build.yml
|
||||||
- .gitlab-ci/lint.yml
|
- .gitlab-ci/lint.yml
|
||||||
- .gitlab-ci/shellcheck.yml
|
|
||||||
- .gitlab-ci/terraform.yml
|
- .gitlab-ci/terraform.yml
|
||||||
- .gitlab-ci/packet.yml
|
- .gitlab-ci/packet.yml
|
||||||
- .gitlab-ci/vagrant.yml
|
- .gitlab-ci/vagrant.yml
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
---
|
|
||||||
shellcheck:
|
|
||||||
extends: .job
|
|
||||||
stage: unit-tests
|
|
||||||
tags: [light]
|
|
||||||
variables:
|
|
||||||
SHELLCHECK_VERSION: v0.7.1
|
|
||||||
before_script:
|
|
||||||
- ./tests/scripts/rebase.sh
|
|
||||||
- curl --silent --location "https://github.com/koalaman/shellcheck/releases/download/"${SHELLCHECK_VERSION}"/shellcheck-"${SHELLCHECK_VERSION}".linux.x86_64.tar.xz" | tar -xJv
|
|
||||||
- cp shellcheck-"${SHELLCHECK_VERSION}"/shellcheck /usr/bin/
|
|
||||||
- shellcheck --version
|
|
||||||
script:
|
|
||||||
# Run shellcheck for all *.sh
|
|
||||||
- find . -name '*.sh' -not -path './.git/*' | xargs shellcheck --severity error
|
|
||||||
except: ['triggers', 'master']
|
|
|
@ -27,11 +27,11 @@ repos:
|
||||||
args: [-r, "~MD013,~MD029"]
|
args: [-r, "~MD013,~MD029"]
|
||||||
exclude: "^.git"
|
exclude: "^.git"
|
||||||
|
|
||||||
- repo: https://github.com/jumanjihouse/pre-commit-hooks
|
- repo: https://github.com/shellcheck-py/shellcheck-py
|
||||||
rev: 3.0.0
|
rev: v0.10.0.1
|
||||||
hooks:
|
hooks:
|
||||||
- id: shellcheck
|
- id: shellcheck
|
||||||
args: [--severity, "error"]
|
args: ["--severity=error"]
|
||||||
exclude: "^.git"
|
exclude: "^.git"
|
||||||
files: "\\.sh$"
|
files: "\\.sh$"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue