Skip to content

Commit

Permalink
Add pre-commit hook to check go mod tidy has been run.
Browse files Browse the repository at this point in the history
  • Loading branch information
simonwo committed Oct 24, 2022
1 parent ad05a25 commit d634846
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitprecommit/go_mod_tidy_check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

# Run go mod tidy and check for changes
make modtidy check-diff
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@ repos:
name: golangci-lint --fix
entry: .gitprecommit/golangci-lint.sh
language: script
- id: go-mod-tidy-check
name: make modtidy check-diff
entry: .gitprecommit/go_mod_tidy_check.sh
language: script

0 comments on commit d634846

Please sign in to comment.