项目作者: syntaqx

项目描述 :
A collection of git hooks for use with pre-commit
高级语言: Shell
项目地址: git://github.com/syntaqx/git-hooks.git
创建时间: 2019-03-27T09:46:28Z
项目社区:https://github.com/syntaqx/git-hooks

开源协议:MIT License

下载


" class="reference-link">git-hooks

pre-commit workflow

A collection of useful Git hooks for use with pre-commit.

Available hooks

  • circleci-config-validate - Test if the CircleCI config file is well formed.
  • forbid-binary - Prevent binary files from being committed.
  • go-fmt - Runs go fmt and asserts no changes are needed.
  • go-test - Runs go test and asserts no tests are failing.
  • go-mod-tidy - Runs go mod tidy and asserts all dependencies have been added.
  • go-generate - Runs go generate aginst the projects go files.
  • shellcheck - Run shellcheck against scripts.
  • shfmt - Run shfmt against scripts.

Configure pre-commit

Create or append to your .pre-commit-config.yaml configuration:

  1. - repo: https://github.com/syntaqx/git-hooks
  2. rev: v0.0.18
  3. hooks:
  4. - id: circleci-config-validate
  5. - id: forbid-binary
  6. - id: go-fmt
  7. - id: go-test
  8. - id: go-mod-tidy
  9. - id: go-generate
  10. - id: shellcheck
  11. - id: shfmt

License

git-hooks is open source software released under the MIT license.