Skip to content

Commit

Permalink
Remove shadowing of config attribute in hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
totoroot committed Feb 16, 2024
1 parent 2ce4972 commit eb418b0
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions modules/hooks.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1099,10 +1099,10 @@ in
description = lib.mdDoc "When to use generate output.";
default = "auto";
};
config =
configuration =
mkOption {
type = types.str;
description = lib.mdDoc "Multiline-string configuration passed as config file. If set, config set in `typos.settings.configPath` gets ignored.";
description = lib.mdDoc "Multiline-string configuration passed as configuration file. If set, configuration file set in `typos.settings.configPath` gets ignored.";
default = "";
example = ''
[files]
Expand Down Expand Up @@ -1201,10 +1201,10 @@ in
};
};
vale = {
config =
configuration =
mkOption {
type = types.str;
description = lib.mdDoc "Multiline-string configuration passed as config file.";
description = lib.mdDoc "Multiline-string configuration passed as configuration file.";
default = "";
example = ''
MinAlertLevel = suggestion
Expand All @@ -1215,7 +1215,7 @@ in
configPath =
mkOption {
type = types.str;
description = lib.mdDoc "Path to the config file.";
description = lib.mdDoc "Path to a configuration file.";
default = "";
};
flags =
Expand Down Expand Up @@ -2496,15 +2496,15 @@ in
entry =
let
# Concatenate config in config file with section for ignoring words generated from list of words to ignore
config = "${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;
configFile = builtins.toFile "typos-config.toml" config;
configuration = "${settings.typos.configuration}" + lib.strings.optionalString (settings.typos.ignored-words != [ ]) "\n\[default.extend-words\]" + lib.strings.concatMapStrings (x: "\n${x} = \"${x}\"") settings.typos.ignored-words;
configFile = builtins.toFile "typos-config.toml" configuration;
cmdArgs =
mkCmdArgs
(with settings.typos; [
[ binary "--binary" ]
[ (color != "auto") "--color ${color}" ]
[ (config != "") "--config ${configFile}" ]
[ (configPath != "" && config == "") "--config ${configPath}" ]
[ (configuration != "") "--config ${configFile}" ]
[ (configPath != "" && configuration == "") "--config ${configPath}" ]
[ diff "--diff" ]
[ (exclude != "") "--exclude ${exclude} --force-exclude" ]
[ (format != "long") "--format ${format}" ]
Expand Down Expand Up @@ -2532,12 +2532,12 @@ in
description = "A markup-aware linter for prose built with speed and extensibility in mind.";
entry =
let
configFile = builtins.toFile ".vale.ini" "${settings.vale.config}";
configFile = builtins.toFile ".vale.ini" "${settings.vale.configuration}";
cmdArgs =
mkCmdArgs
(with settings.vale; [
[ (configPath != "") " --config ${configPath}" ]
[ (config != "" && configPath == "") " --config ${configFile}" ]
[ (configuration != "" && configPath == "") " --config ${configFile}" ]
]);
in
"${pkgs.vale}/bin/vale${cmdArgs} ${settings.vale.flags}";
Expand Down

0 comments on commit eb418b0

Please sign in to comment.