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

actions-workflow: add check for formatting #1782

Merged
merged 2 commits into from
Oct 25, 2021

Conversation

etungsten
Copy link
Contributor

@etungsten etungsten commented Oct 18, 2021

Issue number:
Partially addresses #1776

Description of changes:

Author: Erikson Tung <[email protected]>
Date:   Mon Oct 18 14:00:56 2021 -0700

    sources,tools: cargo fmt
    
    Runs cargo-fmt over all first-party source code.

Author: Erikson Tung <[email protected]>
Date:   Mon Oct 18 14:46:46 2021 -0700

    actions-workflow: add check for formatting
    
    Adds a new cargo-make task,'check-fmt', that checks first-party source code
    formatting.
    Adds 'check-fmt' to github actions build workflow.

Testing done:
The cargo-make task works as expected:

With unformatted code:

[cargo-make] INFO - cargo make 0.35.0
[cargo-make] INFO - Build File: Makefile.toml
[cargo-make] INFO - Task: check-fmt
[cargo-make] INFO - Profile: development
[cargo-make] INFO - Running Task: setup
[cargo-make] INFO - Running Task: check-fmt
/home/ANT.AMAZON.COM/etung/thar/PRIVATE-thar/sources/host-ctr/cmd/host-ctr/main.go
/home/ANT.AMAZON.COM/etung/thar/PRIVATE-thar/sources/api/datastore/src/lib.rs
/home/ANT.AMAZON.COM/etung/thar/PRIVATE-thar/sources/api/datastore/src/lib.rs
/home/ANT.AMAZON.COM/etung/thar/PRIVATE-thar/tools/infrasys/src/main.rs
Found unformatted source files listed above. First-party source code is checked with gofmt and rustfmt.
[cargo-make] ERROR - Error while executing command, exit code: 1
[cargo-make] WARN - Build Failed.

Checking the additional workflow step with this PR

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

Copy link
Contributor

@webern webern left a comment

Choose a reason for hiding this comment

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

🍰

@etungsten
Copy link
Contributor Author

Push above makes it so that we use gofmt from bottlerocket-sdk's go toolchain

@etungsten etungsten marked this pull request as draft October 18, 2021 23:08
@etungsten etungsten force-pushed the cargo-fmt-everywhere branch 3 times, most recently from caacf2b to 01025f9 Compare October 18, 2021 23:36
@etungsten etungsten marked this pull request as ready for review October 19, 2021 00:00
@etungsten etungsten requested a review from webern October 19, 2021 00:00
Runs cargo-fmt over all first-party source code.
Adds a new cargo-make task,'check-fmt', that checks first-party source code
formatting.
Adds 'check-fmt' to github actions build workflow.
@etungsten
Copy link
Contributor Author

Push above fixes conflicts

@etungsten etungsten merged commit e8b9038 into bottlerocket-os:develop Oct 25, 2021
@etungsten etungsten deleted the cargo-fmt-everywhere branch October 25, 2021 18:11
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.

4 participants