Skip to content

Commit

Permalink
fix(pre-commit): add more linters, more improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
shakefu committed Nov 18, 2023
1 parent d5187bc commit 3a6269e
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 14 deletions.
40 changes: 27 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,31 @@
repos:
- repo: https://github.com/turo/pre-commit-hooks
rev: v3.4.2
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: go-mod-tidy
- id: go-build
- id: golangci-lint
- id: go-test-unit
- id: gomarkdoc
# - id: docker-lint # Getting in the way
- id: docker-compose-lint
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
hooks:
- id: prettier
stages: [commit]
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.5.0
rev: v9.9.0
hooks:
- id: commitlint
stages: [commit-msg]
additional_dependencies: ["@open-turo/commitlint-config-conventional"]
- repo: https://github.com/rhysd/actionlint
rev: v1.6.17
hooks:
- id: actionlint
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 3.0.0
hooks:
- id: shellcheck
# - id: shfmt
- repo: https://github.com/hadolint/hadolint
rev: v2.12.0
hooks:
- id: commitlint
stages: [commit-msg]
additional_dependencies: ["@open-turo/commitlint-config-conventional"]
- id: hadolint
6 changes: 5 additions & 1 deletion files/.githooks/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#!/bin/sh
# This hook runs the commitizen script when you commit to prompt you to create
# conventional commit messages

# Exit quietly if cz doesn't exist
[ -x "$(command -v cz)" ] || exit 0
# Prevent issues when rebasing
[ "$1" = ".git/COMMIT_EDITMSG" ] && [ "$2" = "message" ] && exit 0
# Run the commitizen script
exec < /dev/tty && cz --hook || true
# shellcheck disable=SC2015
exec < /dev/tty && cz --hook || true
3 changes: 3 additions & 0 deletions install/linux_amd64/actionlint
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/dash -e
# Install or upgrade
$RUN brew "$( { [ -z "$UPGRADE" ] && echo "install"; } || echo "upgrade" )" "$NAME"
3 changes: 3 additions & 0 deletions install/linux_amd64/hadolint
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/dash -e
# Install or upgrade
$RUN brew "$( { [ -z "$UPGRADE" ] && echo "install"; } || echo "upgrade" )" "$NAME"

0 comments on commit 3a6269e

Please sign in to comment.