From b3ff86fcd0a1cd990dbec5b9efff5578e6202967 Mon Sep 17 00:00:00 2001 From: r-vdp Date: Wed, 23 Oct 2024 11:09:49 +0200 Subject: [PATCH] fix: avoid use of deprecated stage names These cause warnings with recent versions of pre-commit, and will be removed in the future. --- README.md | 2 +- modules/hooks.nix | 8 ++++---- nix/installation-test.nix | 2 +- nix/run.nix | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 5f818620..b7c9c499 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,7 @@ nix develop pre-commit-check = nix-pre-commit-hooks.run { src = ./.; # If your hooks are intrusive, avoid running on each commit with a default_states like this: - # default_stages = ["manual" "push"]; + # default_stages = ["manual" "pre-push"]; hooks = { elm-format.enable = true; diff --git a/modules/hooks.nix b/modules/hooks.nix index 7159fc44..a585b962 100644 --- a/modules/hooks.nix +++ b/modules/hooks.nix @@ -2047,7 +2047,7 @@ in description = "Prevent very large files to be committed (e.g. binaries)."; package = tools.pre-commit-hooks; entry = "${hooks.check-added-large-files.package}/bin/check-added-large-files"; - stages = [ "commit" "push" "manual" ]; + stages = [ "pre-commit" "pre-push" "manual" ]; }; check-builtin-literals = { @@ -2080,7 +2080,7 @@ in package = tools.pre-commit-hooks; entry = "${hooks.check-executables-have-shebangs.package}/bin/check-executables-have-shebangs"; types = [ "text" "executable" ]; - stages = [ "commit" "push" "manual" ]; + stages = [ "pre-commit" "pre-push" "manual" ]; }; check-json = { @@ -2113,7 +2113,7 @@ in package = tools.pre-commit-hooks; entry = "${hooks.check-shebang-scripts-are-executable.package}/bin/check-shebang-scripts-are-executable"; types = [ "text" ]; - stages = [ "commit" "push" "manual" ]; + stages = [ "pre-commit" "pre-push" "manual" ]; }; check-symlinks = { @@ -3700,7 +3700,7 @@ lib.escapeShellArgs (lib.concatMap (ext: [ "--ghc-opt" "-X${ext}" ]) hooks.ormol name = "trim-trailing-whitespace"; description = "Trim trailing whitespace."; types = [ "text" ]; - stages = [ "commit" "push" "manual" ]; + stages = [ "pre-commit" "pre-push" "manual" ]; package = tools.pre-commit-hooks; entry = "${hooks.trim-trailing-whitespace.package}/bin/trailing-whitespace-fixer"; }; diff --git a/nix/installation-test.nix b/nix/installation-test.nix index 2d79405d..272dfc5d 100644 --- a/nix/installation-test.nix +++ b/nix/installation-test.nix @@ -54,7 +54,7 @@ let expectedHooks = [ "pre-push" ]; conf.hooks.nixpkgs-fmt = { enable = true; - stages = [ "push" ]; + stages = [ "pre-push" ]; }; }; }; diff --git a/nix/run.nix b/nix/run.nix index 0c6aa45c..3f7a2032 100644 --- a/nix/run.nix +++ b/nix/run.nix @@ -5,7 +5,7 @@ builtinStuff@{ pkgs, tools, isFlakes, pre-commit, git, runCommand, writeText, wr , hooks ? { } , excludes ? [ ] , tools ? { } -, default_stages ? [ "commit" ] +, default_stages ? [ "pre-commit" ] , addGcRoot ? true , imports ? [ ] }: