From 9174965f282e619d9cd20f0f993a436997e33ce8 Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Thu, 12 Sep 2024 20:13:31 +0200 Subject: [PATCH] feat(pre-commit): Switch to pre-push stage for linters --- .forgejo/workflows/lint.yaml | 2 +- default.nix | 23 ++++++++++++++++++----- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/.forgejo/workflows/lint.yaml b/.forgejo/workflows/lint.yaml index 948d0f1..4b58ae7 100644 --- a/.forgejo/workflows/lint.yaml +++ b/.forgejo/workflows/lint.yaml @@ -8,4 +8,4 @@ jobs: - uses: actions/checkout@v3 - name: Run pre-commit on all files - run: nix-shell --run 'pre-commit run --all-files --show-diff-on-failure' -A shells.pre-commit ./. + run: nix-shell --run 'pre-commit run --all-files --hook-stage pre-push --show-diff-on-failure' -A shells.pre-commit ./. diff --git a/default.nix b/default.nix index b68440f..c0981fe 100644 --- a/default.nix +++ b/default.nix @@ -45,12 +45,25 @@ let src = ./.; hooks = { - # Nix Hooks - statix.enable = true; - deadnix.enable = true; - nixfmt-rfc-style.enable = true; + statix = { + enable = true; + stages = [ "pre-push" ]; + settings.ignore = [ + "lon.nix" + "**/npins" + ]; + }; + + deadnix = { + enable = true; + stages = [ "pre-push" ]; + }; + + nixfmt-rfc-style = { + enable = true; + stages = [ "pre-push" ]; + }; - # Misc Hooks commitizen.enable = true; }; };