Skip to content

Commit

Permalink
Convert rustfmt CI run to use stable rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
faern committed Jan 24, 2023
1 parent 5564147 commit 9345200
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/rustfmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,21 @@ on:
- rustfmt.toml
- '**/*.rs'
workflow_dispatch:
env:
RUST_NIGHTLY_TOOLCHAIN: nightly-2023-01-13
jobs:
check-formatting:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install nightly Rust
uses: actions-rs/[email protected]
with:
toolchain: ${{ env.RUST_NIGHTLY_TOOLCHAIN }}
toolchain: stable
components: rustfmt
default: true

- name: Check formatting
run: |-
rustfmt --version
cargo fmt -- --check --unstable-features
cargo fmt -- --check
14 changes: 9 additions & 5 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
edition = "2021"

# Activation of features, almost objectively better ;)
use_try_shorthand = true
use_field_init_shorthand = true
condense_wildcard_suffixes = true
normalize_comments = true
wrap_comments = true
imports_granularity = "Crate"

# Heavily subjective style choices
# Nightly only. Will not run in CI, but please format with these locally
wrap_comments = true
normalize_comments = true
comment_width = 100

condense_wildcard_suffixes = true

imports_granularity = "Crate"

0 comments on commit 9345200

Please sign in to comment.