Skip to content

Commit

Permalink
typos: add force-exclude
Browse files Browse the repository at this point in the history
This came up after a long discussion in [0]. Using this (as default option)
is probably the simplest solution and the most natural behaviour.

[0]: cachix#405
  • Loading branch information
phip1611 committed Apr 19, 2024
1 parent 7e6fcae commit f59dcd3
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion modules/hooks.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1470,6 +1470,15 @@ in
example = "*.nix";
};

force-exclude =
mkOption {
type = types.bool;
description = lib.mdDoc "Respect excluded files from config file even for paths passed explicitly";
# This must be true as this is the natural behaviour. Similar to when executing `typos`
# from the cmdline.
default = true;
};

format =
mkOption {
type = types.enum [ "silent" "brief" "long" "json" ];
Expand Down Expand Up @@ -3361,7 +3370,8 @@ lib.escapeShellArgs (lib.concatMap (ext: [ "--ghc-opt" "-X${ext}" ]) hooks.ormol
# Config file always exists (we generate one if not).
[ true "--config ${pathToConfigFile}" ]
[ diff "--diff" ]
[ (exclude != "") "--exclude ${exclude} --force-exclude" ]
[ (exclude != "") "--exclude ${exclude}" ]
[ (force-exclude) "--force-exclude" ]
[ (format != "long") "--format ${format}" ]
[ hidden "--hidden" ]
[ (locale != "en") "--locale ${locale}" ]
Expand Down

0 comments on commit f59dcd3

Please sign in to comment.