mirror of
https://github.com/nix-community/home-manager.git
synced 2026-06-05 21:02:51 +00:00
statix: enable useless_has_attr
Enable statix's useless_has_attr rule and apply its auto-fixes across the affected modules.
This commit is contained in:
@@ -94,10 +94,8 @@ in
|
||||
|
||||
# Get the blocks if successful, abort if not
|
||||
blocks =
|
||||
if trySortedBlocks ? result then
|
||||
trySortedBlocks.result
|
||||
else
|
||||
abort "Dependency cycle in i3blocks: ${builtins.toJSON trySortedBlocks}";
|
||||
trySortedBlocks.result
|
||||
or (abort "Dependency cycle in i3blocks: ${builtins.toJSON trySortedBlocks}");
|
||||
|
||||
# Turn the blocks back into their name value pairs
|
||||
orderedBlocks = (map (value: (nameValuePairToAttr (dagEntryToNameValue value))) blocks);
|
||||
|
||||
@@ -616,10 +616,7 @@ in
|
||||
sortedMatchBlocks = lib.hm.dag.topoSort (lib.removeAttrs cfg.matchBlocks [ "*" ]);
|
||||
sortedMatchBlocksStr = builtins.toJSON sortedMatchBlocks;
|
||||
matchBlocks =
|
||||
if sortedMatchBlocks ? result then
|
||||
sortedMatchBlocks.result
|
||||
else
|
||||
abort "Dependency cycle in SSH match blocks: ${sortedMatchBlocksStr}";
|
||||
sortedMatchBlocks.result or (abort "Dependency cycle in SSH match blocks: ${sortedMatchBlocksStr}");
|
||||
|
||||
defaultHostBlock = cfg.matchBlocks."*" or null;
|
||||
in
|
||||
|
||||
@@ -337,7 +337,7 @@ let
|
||||
};
|
||||
};
|
||||
};
|
||||
defaultProfile = if cfg.profiles ? default then cfg.profiles.default else { };
|
||||
defaultProfile = cfg.profiles.default or { };
|
||||
allProfilesExceptDefault = removeAttrs cfg.profiles [ "default" ];
|
||||
in
|
||||
{
|
||||
|
||||
@@ -13,6 +13,5 @@ disabled = [
|
||||
"repeated_keys",
|
||||
"redundant_pattern_bind",
|
||||
"unquoted_uri",
|
||||
"useless_has_attr",
|
||||
"useless_parens",
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user