x commit hooks
pre-commit hooks for current projects.
warning some of these scripts are set to fix code.
installed
- python 3.11+
- go 1.21+
- nodejs 16.+
python
pip install --user pre-commit
pip install --user yamllint
pip install --user black flake8 isort
go
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.55.2
npm
npm install --save --save-exact @commitlint/cli @commitlint/config-conventional
npm install --save --save-exact remark-cli remark-preset-lint-recommended
npm install --save --save-exact markdownlint-cli
npm install --save --save-exact prettier
commitlint config
echo "module.exports = {extends: ['@commitlint/config-conventional']}" > commitlint.config.js
shellcheck https://github.com/koalaman/shellcheck
hadolint https://github.com/hadolint/hadolint
generic
./scripts/x-generic-hooks.sh
go
./scripts/x-go-hooks.sh
python
./scripts/x-python-hooks.sh
./scripts/update.sh
To use an example pre-commit config copy the best fit into the root of your
project as .pre-commit-config.yaml
and edit as needed.
- All hooks: pre-commit-config-all.yaml
- Golang hooks: pre-commit-config-go.yaml
- Python hooks: pre-commit-config-python.yaml
build:
docker build -t x-commit-hooks:local .
usage:
docker run -it -v $(pwd):/src:rw,z x-commit-hooks:local x-generic-hooks.sh
- https://github.com/pre-commit/pre-commit
- https://github.com/adrienverge/yamllint
- https://github.com/koalaman/shellcheck
- https://github.com/igorshubovych/markdownlint-cli
- https://github.com/golangci/golangci-lint
- https://github.com/go-lintpack/lintpack
- https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-cli
- https://github.com/conventional-changelog/commitlint