-
Notifications
You must be signed in to change notification settings - Fork 165
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
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 |
I've been using this and it seems to be in a good position will this be merged soon? |
After cachix#396, `reuse` hook no longer works, as it considers untracked files added by `pre-commit`. Before the above PR, the git repository was in `$HOME/src`, so files added in `$HOME` didn't affect the outcome of the hooks themselves. This change re-adds the `src` subdirectory. A failing build output: $ nix build --no-link -L .\#checks.x86_64-linux.pre-commit Running phase: unpackPhase unpacking source archive /nix/store/g1p6g2ylflj4fnzdwlc368737kxk0p9f-source source root is source Running phase: patchPhase Running phase: updateAutotoolsGnuConfigScriptsPhase Running phase: configurePhase no configure script, doing nothing Running phase: buildPhase Running: $ pre-commit run --all-files reuse....................................................................Failed - hook id: reuse - exit code: 1 # MISSING COPYRIGHT AND LICENSING INFORMATION The following files have no copyright and licensing information: * .cache/pre-commit/README * .cache/pre-commit/db.db * .gitconfig # SUMMARY * Bad licenses: 0 * Deprecated licenses: 0 * Licenses without file extension: 0 * Missing licenses: 0 * Unused licenses: 0 * Used licenses: MIT * Read errors: 0 * Files with copyright information: 16 / 19 * Files with license information: 16 / 19 Unfortunately, your project is not compliant with version 3.3 of the REUSE Specification :-( # RECOMMENDATIONS * Fix missing copyright/licensing information: For one or more files, the tool cannot find copyright and/or licensing information. You typically do this by adding 'SPDX-FileCopyrightText' and 'SPDX-License-Identifier' tags to each file. The tutorial explains additional ways to do this: <https://reuse.software/tutorial/>
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.