Skip to content

Commit

Permalink
chore: update pre-commit hooks and add binary check
Browse files Browse the repository at this point in the history
  • Loading branch information
LangLangBart committed Mar 22, 2024
1 parent d40a9bd commit e7109d5
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/workflows/quality_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
uses: luizm/action-sh-checker@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SHELLCHECK_OPTS: --external-sources --norc
SHFMT_OPTS: --simplify --indent 0 --case-indent
with:
sh_checker_comment: true
28 changes: 21 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,32 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/crate-ci/typos
rev: typos-v0.10.21
rev: v1.19.0
hooks:
- id: typos
args: [--format, brief, --write-changes]
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.6
- repo: local
hooks:
# doesn't require a local version of 'shellcheck'
- id: shellcheck
- id: binaries
name: binary check for shellcheck/shfmt
entry: |
bash -c '
for tool in shellcheck shfmt; do
if ! command -v shellcheck &> /dev/null; then
echo "$tool could not be found, please install it"
exit 1
fi
done'
language: system
pass_filenames: false
fail_fast: true
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 3.0.0
hooks:
# requires a local version of 'shellcheck'
- id: shellcheck
name: shellcheck
args: [--external-source, --norc]
# requires a local version of 'shfmt'
- id: shfmt
name: shfmt
Expand All @@ -39,13 +53,13 @@ repos:
hooks:
- id: yamlfix
- repo: https://github.com/tcort/markdown-link-check
rev: v3.11.2
rev: v3.12.1
hooks:
- id: markdown-link-check
name: markdown link check
args: [--quiet]
- repo: https://github.com/commitizen-tools/commitizen
rev: v3.14.1
rev: v3.20.0
hooks:
- id: commitizen
stages: [commit-msg]
3 changes: 2 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ MAX_LINES_HISTORY="1000" gh find-code
> introduction](https://pre-commit.com/#introduction)
```sh
brew install pre-commit
# shellcheck and shfmt are necessary dependencies for one hook
brew install pre-commit shellcheck shfmt

# install the git hook scripts
pre-commit install --hook-type commit-msg --hook-type pre-commit
Expand Down

0 comments on commit e7109d5

Please sign in to comment.