From 2b9608f3c679ca55b2d0083aa8d6672783e2c068 Mon Sep 17 00:00:00 2001 From: Wim de With Date: Sat, 5 Aug 2023 18:37:23 +0200 Subject: [PATCH] Expose always_run option --- modules/pre-commit.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/pre-commit.nix b/modules/pre-commit.nix index 5262e099..261c91f7 100644 --- a/modules/pre-commit.nix +++ b/modules/pre-commit.nix @@ -148,12 +148,19 @@ let forces the output of the hook to be printed even when the hook passes. ''; }; + always_run = mkOption { + type = types.bool; + default = false; + description = lib.mdDoc '' + if true this hook will run even if there are no matching files. + ''; + }; }; config = { raw = { - inherit (config) name entry language files stages types types_or pass_filenames verbose; + inherit (config) name entry language files stages types types_or pass_filenames verbose always_run; id = name; exclude = mergeExcludes config.excludes; };