Skip to content

Commit f94f8e2

Browse files
committed
Remove shadowing of config attribute in hooks
1 parent 54189ae commit f94f8e2

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

modules/hooks.nix

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ in
586586
"The diagnostic check level";
587587
default = "Warning";
588588
};
589-
config = mkOption {
589+
configuration = mkOption {
590590
type = types.attrs;
591591
description = lib.mdDoc
592592
"See https://github.com/LuaLS/lua-language-server/wiki/Configuration-File#luarcjson";
@@ -620,7 +620,7 @@ in
620620
type = types.submodule {
621621
imports = hookModule;
622622
options.settings = {
623-
config =
623+
configuration =
624624
mkOption {
625625
type = types.attrs;
626626
description = lib.mdDoc
@@ -1368,7 +1368,7 @@ in
13681368
default = "auto";
13691369
};
13701370

1371-
config =
1371+
configuration =
13721372
mkOption {
13731373
type = types.str;
13741374
description = lib.mdDoc "Multiline-string configuration passed as config file. If set, config set in `typos.settings.configPath` gets ignored.";
@@ -1489,7 +1489,7 @@ in
14891489
type = types.submodule {
14901490
imports = hookModule;
14911491
options.settings = {
1492-
config =
1492+
configuration =
14931493
mkOption {
14941494
type = types.str;
14951495
description = lib.mdDoc "Multiline-string configuration passed as config file.";
@@ -2955,15 +2955,15 @@ in
29552955
entry =
29562956
let
29572957
# Concatenate config in config file with section for ignoring words generated from list of words to ignore
2958-
config = "${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;
2959-
configFile = builtins.toFile "typos-config.toml" config;
2958+
configuration = "${hooks.typos.settings.configuration}" + lib.strings.optionalString (hooks.typos.settings.ignored-words != [ ]) "\n\[default.extend-words\]" + lib.strings.concatMapStrings (x: "\n${x} = \"${x}\"") hooks.typos.settings.ignored-words;
2959+
configFile = builtins.toFile "typos-config.toml" configuration;
29602960
cmdArgs =
29612961
mkCmdArgs
29622962
(with hooks.typos.settings; [
29632963
[ binary "--binary" ]
29642964
[ (color != "auto") "--color ${color}" ]
2965-
[ (config != "") "--config ${configFile}" ]
2966-
[ (configPath != "" && config == "") "--config ${configPath}" ]
2965+
[ (configuration != "") "--config ${configFile}" ]
2966+
[ (configPath != "" && configuration == "") "--config ${configPath}" ]
29672967
[ diff "--diff" ]
29682968
[ (exclude != "") "--exclude ${exclude} --force-exclude" ]
29692969
[ (format != "long") "--format ${format}" ]
@@ -2993,13 +2993,12 @@ in
29932993
package = tools.vale;
29942994
entry =
29952995
let
2996-
# TODO: was .vale.ini, throwed error in Nix
2997-
configFile = builtins.toFile "vale.ini" "${hooks.vale.settings.config}";
2996+
configFile = builtins.toFile ".vale.ini" "${hooks.vale.settings.configuration}";
29982997
cmdArgs =
29992998
mkCmdArgs
30002999
(with hooks.vale.settings; [
30013000
[ (configPath != "") " --config ${configPath}" ]
3002-
[ (config != "" && configPath == "") " --config ${configFile}" ]
3001+
[ (configuration != "" && configPath == "") " --config ${configFile}" ]
30033002
]);
30043003
in
30053004
"${hooks.vale.package}/bin/vale${cmdArgs} ${hooks.vale.settings.flags}";

0 commit comments

Comments
 (0)