Skip to content

Commit

Permalink
Faster pre-commit hooks
Browse files Browse the repository at this point in the history
The idea is to speed up pre-commit for day-to-day use. Since golangci-lint
runs a full build it takes some time to complete. Enforce it only at
pre-push time, not for pre-commit.

Also since build can take quite some time, we don't want it to fail three
times: once is enough.
  • Loading branch information
cbosdo committed Nov 13, 2024
1 parent 3683d4f commit f2302f1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ repos:
rev: v1.59.1
hooks:
- id: golangci-lint
fail_fast: true
stages:
- pre-push

- repo: https://github.com/fsfe/reuse-tool
rev: v4.0.3
Expand All @@ -38,13 +41,15 @@ repos:
language: script
- id: build
name: Build
fail_fast: true
pass_filenames: false
entry: ./pre-commit-build.sh
language: script
stages:
- pre-push
- id: build-all-tags
name: Build with all tags
fail_fast: true
pass_filenames: false
entry: ./pre-commit-build.sh
language: script
Expand Down

0 comments on commit f2302f1

Please sign in to comment.