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

build: check clippy and cargo fmt during github actions checks #1776

Closed
webern opened this issue Oct 13, 2021 · 2 comments · Fixed by #2745
Closed

build: check clippy and cargo fmt during github actions checks #1776

webern opened this issue Oct 13, 2021 · 2 comments · Fixed by #2745
Labels
area/core Issues core to the OS (variant independent) good first issue May be a good issue for new contributors
Milestone

Comments

@webern
Copy link
Contributor

webern commented Oct 13, 2021

What I'd like:

During GitHub actions CI, the build should fail (preferably early) if the code is not fmt'ed with cargo fmt and if it has cargo clippy warnings.

We probably wouldn't want this to happen as part of the RPM build process. Instead this would probably be more like what we do now with cargo test. The downside is that a mismatch between the version of cargo in the build runners and a developer's local version of cargo could cause a mismatch in clippy lints (less likely that a fmt mismatch would occur).

Any alternatives you've considered:

  • Doing this with the SDK
  • Doing this with "local" cargo/rust
  • Don't check lint/fmt in CI
@webern webern added the area/core Issues core to the OS (variant independent) label Oct 13, 2021
@webern
Copy link
Contributor Author

webern commented Oct 13, 2021

The simplest solution might be to add these under the existing target cargo make test. (Note that cargo make test only runs sources tests currently. We should probably expand the cargo make test target to encompass both sources and tools)

@jpmcb
Copy link
Contributor

jpmcb commented Sep 6, 2022

Closing since this was accomplished earlier this year ✅

- run: cargo make -e BUILDSYS_VARIANT=${{ matrix.variant }} unit-tests
- run: cargo make -e BUILDSYS_VARIANT=${{ matrix.variant }} check-fmt
- run: cargo make -e BUILDSYS_VARIANT=${{ matrix.variant }} check-lints

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core Issues core to the OS (variant independent) good first issue May be a good issue for new contributors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants