Skip to content

ci: automated nightly rustfmt scheduled/manual PRs#2135

Merged
apoelstra merged 1 commit intorust-bitcoin:masterfrom
realeinherjar:einherjar/ci/rustfmt
Oct 22, 2023
Merged

ci: automated nightly rustfmt scheduled/manual PRs#2135
apoelstra merged 1 commit intorust-bitcoin:masterfrom
realeinherjar:einherjar/ci/rustfmt

Conversation

@realeinherjar
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member

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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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