Skip to content
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

Fail the build on rustc warnings #95

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

johanot
Copy link
Collaborator

@johanot johanot commented Oct 19, 2024

Prevents many preventable mistakes and ensures proper code cleanup after removed features etc.

@johanot johanot mentioned this pull request Oct 19, 2024
Comment on lines +29 to +33
craneLib = (crane.mkLib final).overrideScope (_: scopePrev: {
mkCargoDerivation = args: scopePrev.mkCargoDerivation ({
RUSTFLAGS = "-D warnings";
} // args);
});
Copy link
Member

@cafkafk cafkafk Oct 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer if this was done elsewhere, as it's rather aggressive to deny warnings (such as e.g. unused variables not being prefixed with underscores).

I think if the goal is to increase correctness of the codebase, adding a clippy flake check with all the flags, and then putting it in CI makes much more sense, there are examples of such checks in the crane repo in the examples folder that could essentially be copied.

That way we don't break fast iteration speed of "compiler driven development" but instead move the validation of pedantics to the finalization of a contribution.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably just me that primarily uses cargo (rather than nix build) for compiler-driven-dev (shrug). I'm fine with moving it to a flake check as long as it fails the GH pipeline protecting main :) Will look at it as soon as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants