Skip to content

Commit 5dcc460

Browse files
committed
typos: add force-exclude setting (default true)
Although that is not the solution for the performance problems (in form of huge amounts of resources are consumed) of `typos` discussed in [0] and referenced discussions, this is technically the right thing to do and what users expect. [0]: #405
1 parent 7e6fcae commit 5dcc460

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

modules/hooks.nix

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1470,6 +1470,15 @@ in
14701470
example = "*.nix";
14711471
};
14721472

1473+
force-exclude =
1474+
mkOption {
1475+
type = types.bool;
1476+
description = lib.mdDoc "Respect excluded files from config file even for paths passed explicitly";
1477+
# This must be true as this is the natural behaviour. Similar to when executing `typos`
1478+
# from the cmdline.
1479+
default = true;
1480+
};
1481+
14731482
format =
14741483
mkOption {
14751484
type = types.enum [ "silent" "brief" "long" "json" ];
@@ -3361,7 +3370,8 @@ lib.escapeShellArgs (lib.concatMap (ext: [ "--ghc-opt" "-X${ext}" ]) hooks.ormol
33613370
# Config file always exists (we generate one if not).
33623371
[ true "--config ${pathToConfigFile}" ]
33633372
[ diff "--diff" ]
3364-
[ (exclude != "") "--exclude ${exclude} --force-exclude" ]
3373+
[ (exclude != "") "--exclude ${exclude}" ]
3374+
[ (force-exclude) "--force-exclude" ]
33653375
[ (format != "long") "--format ${format}" ]
33663376
[ hidden "--hidden" ]
33673377
[ (locale != "en") "--locale ${locale}" ]

0 commit comments

Comments
 (0)