Skip to content

Commit

Permalink
typos: add force-exclude setting (default true)
Browse files Browse the repository at this point in the history
Although that is not the solution for the performance problems
(in form of huge amounts of resources are consumed) of `typos`
discussed in [0], referenced discussions, and the previous commit,
this is technically the right thing to do and what users expect.

[0]: #405
  • Loading branch information
phip1611 committed Apr 19, 2024
1 parent f826a04 commit 46b368e
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 @@ -1476,6 +1476,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 @@ -3375,7 +3384,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 46b368e

Please sign in to comment.