ci: nightly rustfmt PR scheduled/manual

This commit is contained in:
Einherjar 2023-10-21 10:37:24 -03:00
parent fe07c13bcc
commit d391ada5b8
No known key found for this signature in database
GPG Key ID: E7ED7E35F072CA83
3 changed files with 27 additions and 7 deletions

View File

@ -58,7 +58,7 @@ jobs:
uses: dtolnay/rust-toolchain@nightly
- name: Running test script
env:
DO_FMT: true
DO_FMT: false
DO_BENCH: true
AS_DEPENDENCY: false
DO_NO_STD: true

26
.github/workflows/rustfmt.yml vendored Normal file
View File

@ -0,0 +1,26 @@
name: Nightly rustfmt
on:
schedule:
- cron: "0 0 * * 0" # runs weekly on Sunday at 00:00
workflow_dispatch: # allows manual triggering
jobs:
format:
name: Nightly rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- name: Run Nightly rustfmt
run: cargo +nightly fmt
- name: Get the current date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
title: Automated nightly rustfmt (${{ env.date }})
body: |
Automated nightly `rustfmt` changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action
commit-message: ${{ env.date }} automated rustfmt nightly
labels: rustfmt

View File

@ -195,12 +195,6 @@ any of the following conditions:
Library reflects Bitcoin Core approach whenever possible.
### Formatting
The repository currently uses `rustfmt` (WIP, some directories are excluded). We use nightly
features so to run the formatter use `cargo +nightly fmt`. (Remember that your editor may be
configured to fmt with a stable toolchain, this will result in many unwanted changes.)
### Naming conventions
Naming of data structures/enums and their fields/variants must follow names used