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

Test in CI that stubs don't generate clippy warnings #1826

Closed
senekor opened this issue Dec 15, 2023 · 1 comment · Fixed by #1830
Closed

Test in CI that stubs don't generate clippy warnings #1826

senekor opened this issue Dec 15, 2023 · 1 comment · Fixed by #1830

Comments

@senekor
Copy link
Contributor

senekor commented Dec 15, 2023

With the current plan to run clippy in our analyzer, it would be benefitial to make sure stubs don't trigger clippy warnings.

Currently, an annoyance that impacts many exercises is clippy::new_without_default:

you should consider adding a Default implementation

This lint is definitely good in general settings, but not for us. We don't want to force students to write constructors in terms of the Default trait. They may not even be at a stage of their learning where they are comfortable with traits. And an exercise is not a library to be published where it's important to have the standard traits implemented.

We might consider suppressing this lint (and possibly others) via the recently stabilized lint configuration through cargo. This will keep the code of the student's solution clean and provide a good experience, be that locally or online.

@senekor
Copy link
Contributor Author

senekor commented Dec 15, 2023

Implementation idea: Add a new test in rust-tooling/ci-tests. Run clippy over each exercise in parallel by spawning a child process for each. Create a temporary directory for each exercise and point cargo to that as the target directory, to avoid modifying any files in the repo. Don't let child processes inherit stdout (might get messed up due to parallelism), instead collect outputs and collect dem into a nicely formatted logfile (e.g. in the repo root, added to gitignore).

@senekor senekor changed the title Tets in CI that stubs don't generate clippy warnings Test in CI that stubs don't generate clippy warnings Dec 16, 2023
@senekor senekor linked a pull request Dec 16, 2023 that will close this issue
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 a pull request may close this issue.

1 participant