-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Propagate current path through the rust code #130
Conversation
c4a1f3d
to
13346e0
Compare
src/eval/execution.rs
Outdated
@@ -172,16 +171,11 @@ fn nix_value_from_module( | |||
scope: &mut v8::ContextScope<v8::HandleScope>, | |||
nix_value: v8::Local<v8::Function>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not related to your change, but I believe this variable has a misleading name. I think this should be nix_module_fn
or something like that. If you agree, would you mind changing it while you're here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
src/tests/mod.rs
Outdated
Ok(val) => val, | ||
Err(err) => panic!( | ||
"eval '{}' shouldn't fail.\nError message: {}", | ||
"eval '{}' shouldn't fail.\nError message: {:?}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Total nitpick (feel free to ignore or do in a separate PR):
"eval '{}' shouldn't fail.\nError message: {:?}", | |
"eval '{nix_expr}' shouldn't fail.\nError message: {err:?}", |
Then the line below can be removed.
src/tests/mod.rs
Outdated
nix_expr, err | ||
), | ||
} | ||
} | ||
|
||
fn eval_err(nix_expr: &str) -> NixErrorKind { | ||
evaluate(nix_expr) | ||
let workdir = std::env::current_dir().unwrap(); | ||
evaluate(nix_expr, &workdir) | ||
.expect_err(&format!("eval '{}' expected an error", nix_expr)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above (feel free to ignore etc.):
.expect_err(&format!("eval '{}' expected an error", nix_expr)) | |
.expect_err(&format!("eval '{}' expected an error", nix_expr)) |
.expect_err(&format!("eval '{}' expected an error", nix_expr)) | |
.expect_err(&format!("eval '{nix_expr}' expected an error")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want these things to be picked up automatically, we can add clippy
Propagating current path (workdir) through the rust code.
Propagate current path through the rust code
Propagating current path (workdir) through the rust code.