Run linter+formatter.

This commit is contained in:
Kevin Baensch 2023-09-11 21:20:14 +02:00
parent 8fd1b6c982
commit e2330f01fc
Signed by: derped
GPG key ID: C0F1D326C7626543
16 changed files with 58 additions and 54 deletions

16
fn.nix
View file

@ -21,17 +21,17 @@ with lib; rec {
(filterAttrs (n: v: v == t)
(readDir p)))
(v: ((optionalString b "${p}/") + v)));
lsf = p: (lst {p = p;});
lsf = p: (lst {inherit p;});
lsd = p: (lst {
p = p;
inherit p;
t = "directory";
b = true;
});
lsfRec = p: b:
flatten ((map (np: lsfRec np b) (lsd p))
++ (lst {
p = p;
b = b;
inherit p;
inherit b;
}));
hasAttrs = aList: d: (map
(a: (ifelse (isList a)
@ -53,11 +53,11 @@ with lib; rec {
(meetsConDo cond do t));
deps = p:
ifelse (isAttrs p) (
filter (p: isAttrs p)
filter isAttrs
(p.buildInputs ++ p.nativeBuildInputs ++ p.propagatedBuildInputs ++ p.propagatedNativeBuildInputs)
) [];
importFilter = l: p: filter (n: elem (nameFromURL (toString n) ".") l) p;
depsRec = ld: ifelse (ld == []) [] ((toList ld) ++ (depsRec (lists.unique (lists.flatten (map (d: deps d) (toList ld))))));
importFilter = l: filter (n: elem (nameFromURL (toString n) ".") l);
depsRec = ld: ifelse (ld == []) [] ((toList ld) ++ (depsRec (lists.unique (lists.flatten (map deps (toList ld))))));
isBroken = p:
meetsConDo (s: ((hasAttrByPath s.path p) && (s.check (getAttrFromPath s.path p)))) (s: s.msg)
[
@ -113,7 +113,7 @@ with lib; rec {
makeOptionTypeList = path: (
lists.forEach
# get a list of all files ending in .nix in path
(filter (filePath: hasSuffix ".nix" filePath)
(filter (hasSuffix ".nix")
(lsfRec path true))
# remove leading path and trailing ".nix", replace every slash with "::"
(replaceStrings ["${path}/" "/" ".nix"] ["" "::" ""])