-
Notifications
You must be signed in to change notification settings - Fork 155
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
feat: support cargo/runtime dependencies #396
base: master
Are you sure you want to change the base?
Conversation
Sorry for the mess, we revamed module structure in #397, could you port these changes over? |
Done 😄 |
@domenkozar looks like this is conflicted again. Please let me know if you would like to get this merged, and I will resolve conflicts one more time 😃 |
Yeah sorry :( |
Does #430 address this? |
It looks like it addresses this partially.
I'll have to look into it at a later time. |
@domenkozar Actually, I don't think #430 addresses the Or am I missing something? |
I'm just wondering if this is the right place to inject these dependencies. Can they go into the packages for Otherwise, aren't the individual hook |
You mean using something like
No, they're not. Clippy will fetch the crates from the crate registy (just as
Yes. |
No, I meant using My current concerns/thoughts/ideas:
|
I see.
Here are my thoughts:
Good point. I guess they could go in a
I would say YAGNI. The options could be deprecated and copied into such an attrset if that is needed one day.
Yes, I think so. |
@mrcjkb, let's get this merged in. Would you have time to work on this? Let's re-use |
Sure. I'm sick today, but hopefully I'll be able to pick it up again soon 😄 |
Seems like this PR conflicts with the main branch |
Totally forgot about this. |
499c28e
to
43da434
Compare
612be66
to
ec0f4d9
Compare
@sandydoo I finally got around to this again. I've updated the PR to reuse It would be nice to have |
description = "Path to Cargo.toml"; | ||
default = null; | ||
rust = { | ||
check.cargoDeps = mkOption { |
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.
@domenkozar, need to make a call here.
This is a setting that'll only be used to fix nix flake check
. Other hooks might need to make their own modifications to the derivation used in flake check.
Should we prefix them somehow or not?
Fixes #126.
Fixes #452.
Fixes #455.
If a Rust project has dependencies, cargo-clippy and cargo check will fail in the pre-commit-check derivation.
This adds a
settings.rust.check.cargoDeps
andoption, which can be used to specify the dependencies, e.g.settings.runtimeDeps
and reuses the hooks'
extraPackages
asnativeBuildInputs
in the derivation, as they are likely to be used in the checks in addition to the devShell environment.