Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
phip1611 committed Mar 19, 2024
1 parent bad175b commit 1e849ba
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions modules/hooks.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2903,25 +2903,25 @@ in
# [0]: https://github.com/cachix/pre-commit-hooks.nix/pull/387#issuecomment-1893600631
configAsFile =
# Highest precedence.
if settings.typos.configFile != null
then (toString settings.typos.configFile)
if hooks.typos.settings.configFile != null
then (toString hooks.typos.settings.configFile)
# Secondary precedence.
else if settings.typos.configPath != ""
then settings.typos.configPath
else if hooks.typos.settings.configPath != ""
then hooks.typos.settings.configPath
# Lowest precedence.
else
builtins.toFile "config.toml"
# Concatenate config in config file with section for ignoring words
# generated from list of words to ignore
("${settings.typos.config}" +
lib.strings.optionalString (settings.typos.ignored-words != [ ]) "\n\[default.extend-words\]" +
lib.strings.concatMapStrings (x: "\n${x} = \"${x}\"") settings.typos.ignored-words
("${hooks.typos.settings.config}" +
lib.strings.optionalString (hooks.typos.settings.ignored-words != [ ]) "\n\[default.extend-words\]" +
lib.strings.concatMapStrings (x: "\n${x} = \"${x}\"") hooks.typos.settings.ignored-words
)
;
# If the config file path is passed as Nix string and not as Nix
# Path, we can't read it from Nix, unfortunately.
excludesFromConfig =
if settings.typos.configPath == "" # passed directly or as Path
if hooks.typos.settings.configPath == "" # passed directly or as Path
then
(
let
Expand Down

0 comments on commit 1e849ba

Please sign in to comment.