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

ci: automated nightly rustfmt scheduled/manual PRs #2135

Merged
merged 1 commit into from
Oct 22, 2023
Merged

ci: automated nightly rustfmt scheduled/manual PRs #2135

merged 1 commit into from
Oct 22, 2023

Conversation

realeinherjar
Copy link
Contributor

@realeinherjar realeinherjar commented Oct 21, 2023

Summary

Details

The new .github/workflows/rustfmt.yml action does the following:

  1. Checkouts the repo
  2. Install the nightly Rust toolchain with rustfmt component
  3. Run cargo +nightly fmt which format all the codebase with the nightly Rust toolchain writing the changes
  4. Add the current date in YYYY-MM-DD format as an GH action ENV var
  5. If changes are detected, create a PR with the following details:
    • Title: Automated nightly rustfmt (DATE)
    • Body: Automated nightly rustfmt changes by create-pull-request GitHub action
    • Commit message: DATE automated rustfmt nightly
    • label: rustfmt

I did a test run (with workflow_dispatch and some minor changes to trigger the PR) in my fork.
Check how the PR looks in https://github.com/realeinherjar/rust-bitcoin/pull/5
Of course, all of these things can be changed.
They are all suggestions...

Security Disclaimer

We are only introducing a new action, which is quite battle-checked, peter-evans/create-pull-request with ~2k stars and proper maintained.

@realeinherjar realeinherjar changed the title ci: nighly rustfmt annotations on PR [WIP] ci: nighly rustfmt annotations on PR Oct 21, 2023
@realeinherjar realeinherjar marked this pull request as draft October 21, 2023 13:38
@realeinherjar realeinherjar changed the title [WIP] ci: nighly rustfmt annotations on PR ci: automated nightly rustfmt scheduled/manual PRs Oct 21, 2023
@realeinherjar realeinherjar marked this pull request as ready for review October 21, 2023 15:00
tcharding
tcharding previously approved these changes Oct 21, 2023
Copy link
Member

@tcharding tcharding left a comment

Choose a reason for hiding this comment

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

Thanks man!

utACK 33ea3d61b776a7c66b37c9876ea79f0a0ad9b6ab

@apoelstra
Copy link
Member

Nice! Too bad we just missed this week's opportunity to test it :).

Copy link
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

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

ACK d391ada

@realeinherjar
Copy link
Contributor Author

Nice! Too bad we just missed this week's opportunity to test it :).

You can trigger manually as well.
Or wait next Sunday 0H UTC

Copy link
Member

@tcharding tcharding left a comment

Choose a reason for hiding this comment

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

ACK d391ada

@apoelstra apoelstra merged commit 49674be into rust-bitcoin:master Oct 22, 2023
@realeinherjar realeinherjar deleted the einherjar/ci/rustfmt branch October 22, 2023 20:21
crywolf added a commit to crywolf/rust-bitcoin that referenced this pull request Nov 25, 2023
apoelstra added a commit that referenced this pull request Nov 26, 2023
5a3f1a6 Remove nightly rustfmt check from pre-commit githook  See #2135 (Vojtěch Toman)

Pull request description:

  See #2135 and discussion [#2219#issuecomment-1826437013](#2219 (comment))

ACKs for top commit:
  Kixunil:
    ACK 5a3f1a6
  apoelstra:
    ACK 5a3f1a6

Tree-SHA512: 3fabadcbc4f80fb133318138aad8e1baccbeffad57d09fe86ed12f1156e8c9505911f8fc3a785896832fad02e20a366e9d95d37602bdd5fc02d9c715a867cb72
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.

rustfmt without nightly toolchain Relax rustfmt rules?
3 participants