fix(natu): track selected dependencies
This commit is contained in:
@@ -8,10 +8,11 @@
|
|||||||
let
|
let
|
||||||
cfg = config.modules.desktop.session.waybar; # NOLINT(let_order)
|
cfg = config.modules.desktop.session.waybar; # NOLINT(let_order)
|
||||||
|
|
||||||
|
vpnClient = config.modules.network.vpn-client;
|
||||||
|
|
||||||
# A Nerd Font Private-Use-Area codepoint as a literal character, decoded
|
# A Nerd Font Private-Use-Area codepoint as a literal character, decoded
|
||||||
# through JSON so the glyph survives as bytes rather than an editor paste.
|
# through JSON so the glyph survives as bytes rather than an editor paste.
|
||||||
g = code: builtins.fromJSON ''"\u${code}"'';
|
g = code: builtins.fromJSON ''"\u${code}"'';
|
||||||
vpnClient = config.modules.network.vpn-client;
|
|
||||||
user = config.user.name;
|
user = config.user.name;
|
||||||
|
|
||||||
sleepOffIcon = builtins.fromJSON ''"\udb81\udcb3"'';
|
sleepOffIcon = builtins.fromJSON ''"\udb81\udcb3"'';
|
||||||
|
|||||||
@@ -16,6 +16,12 @@ let
|
|||||||
|
|
||||||
util = import ./util.nix { inherit lib; };
|
util = import ./util.nix { inherit lib; };
|
||||||
|
|
||||||
|
registry = import ./registry.nix {
|
||||||
|
inherit lib util;
|
||||||
|
hosts = self.nixosConfigurations;
|
||||||
|
root = root + "/registry";
|
||||||
|
};
|
||||||
|
|
||||||
guestModules = import ./guests.nix {
|
guestModules = import ./guests.nix {
|
||||||
inherit
|
inherit
|
||||||
inputs
|
inputs
|
||||||
@@ -27,12 +33,6 @@ let
|
|||||||
root = root + "/guests";
|
root = root + "/guests";
|
||||||
};
|
};
|
||||||
|
|
||||||
registry = import ./registry.nix {
|
|
||||||
inherit lib util;
|
|
||||||
hosts = self.nixosConfigurations;
|
|
||||||
root = root + "/registry";
|
|
||||||
};
|
|
||||||
|
|
||||||
modules = import ./modules.nix {
|
modules = import ./modules.nix {
|
||||||
inherit util;
|
inherit util;
|
||||||
root = root + "/modules";
|
root = root + "/modules";
|
||||||
|
|||||||
@@ -77,6 +77,30 @@ fn natu_preserves_suppressed_bindings() -> googletest::Result<()> {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[gtest]
|
||||||
|
fn natu_reports_select_dependency_order() -> googletest::Result<()> {
|
||||||
|
let report = natu::future_sight(vec![SourceFile {
|
||||||
|
path: PathBuf::from("testdata/select_dependencies.nix"),
|
||||||
|
source: r#"
|
||||||
|
let
|
||||||
|
dependency = { value = 1; };
|
||||||
|
entry = dependency.value;
|
||||||
|
in
|
||||||
|
entry
|
||||||
|
"#
|
||||||
|
.into(),
|
||||||
|
}])
|
||||||
|
.or_fail()?;
|
||||||
|
|
||||||
|
let count = report
|
||||||
|
.diagnostics
|
||||||
|
.iter()
|
||||||
|
.filter(|diagnostic| diagnostic.finding.rule_id == "let_order")
|
||||||
|
.count();
|
||||||
|
expect_that!(count, eq(1));
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
#[gtest]
|
#[gtest]
|
||||||
fn natu_reports_list_to_attrs_after_map() -> googletest::Result<()> {
|
fn natu_reports_list_to_attrs_after_map() -> googletest::Result<()> {
|
||||||
let report = natu::future_sight(vec![SourceFile {
|
let report = natu::future_sight(vec![SourceFile {
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ impl ScopeGraph {
|
|||||||
.iter()
|
.iter()
|
||||||
.flat_map(|expression| self.build_expr(expression, scope))
|
.flat_map(|expression| self.build_expr(expression, scope))
|
||||||
.collect(),
|
.collect(),
|
||||||
ast::Expr::Select(_) => Vec::new(),
|
ast::Expr::Select(select) => vec![self.add_reference(&select.receiver, scope)],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user