From 5e05999429922bc0af51bf9d2df6c8f8efe7a04e Mon Sep 17 00:00:00 2001 From: MarcoIeni <11428655+MarcoIeni@users.noreply.github.com> Date: Wed, 2 Oct 2024 21:48:47 +0200 Subject: [PATCH] chore: use stable rustfmt --- .github/actions/run-fixtures-test/action.yml | 2 +- .github/workflows/ci.yml | 6 +- CONTRIBUTING.md | 2 - git-cliff-core/src/changelog.rs | 2052 ++++++------- git-cliff-core/src/command.rs | 150 +- git-cliff-core/src/commit.rs | 1428 +++++---- git-cliff-core/src/config.rs | 733 +++-- git-cliff-core/src/contributor.rs | 36 +- git-cliff-core/src/embed.rs | 75 +- git-cliff-core/src/error.rs | 235 +- git-cliff-core/src/lib.rs | 4 +- git-cliff-core/src/release.rs | 2667 ++++++++--------- git-cliff-core/src/remote/bitbucket.rs | 256 +- git-cliff-core/src/remote/gitea.rs | 214 +- git-cliff-core/src/remote/github.rs | 218 +- git-cliff-core/src/remote/gitlab.rs | 423 ++- git-cliff-core/src/remote/mod.rs | 507 ++-- git-cliff-core/src/repo.rs | 1422 +++++---- git-cliff-core/src/tag.rs | 68 +- git-cliff-core/src/template.rs | 537 ++-- git-cliff-core/tests/integration_test.rs | 293 +- git-cliff/src/args.rs | 617 ++-- git-cliff/src/bin/completions.rs | 24 +- git-cliff/src/bin/mangen.rs | 19 +- git-cliff/src/lib.rs | 1150 ++++--- git-cliff/src/logger.rs | 274 +- git-cliff/src/main.rs | 68 +- git-cliff/src/profiler.rs | 82 +- rust-toolchain.toml | 2 - rustfmt.toml | 15 - .../docs/installation/build-from-source.md | 2 +- 31 files changed, 6537 insertions(+), 7044 deletions(-) delete mode 100644 rust-toolchain.toml delete mode 100644 rustfmt.toml diff --git a/.github/actions/run-fixtures-test/action.yml b/.github/actions/run-fixtures-test/action.yml index ad9774b1cb..5839612041 100644 --- a/.github/actions/run-fixtures-test/action.yml +++ b/.github/actions/run-fixtures-test/action.yml @@ -18,7 +18,7 @@ runs: using: composite steps: - name: Install toolchain - uses: dtolnay/rust-toolchain@nightly + uses: dtolnay/rust-toolchain@stable - name: Install git-cliff run: cargo install --path git-cliff/ --profile dev diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cd55987c1b..93fd733d7e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,7 +47,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Install toolchain - uses: dtolnay/rust-toolchain@nightly + uses: dtolnay/rust-toolchain@stable - name: Checkout if: github.event_name != 'pull_request' uses: actions/checkout@v4 @@ -84,7 +84,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Install toolchain - uses: dtolnay/rust-toolchain@nightly + uses: dtolnay/rust-toolchain@stable with: components: clippy - name: Checkout @@ -123,7 +123,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Install toolchain - uses: dtolnay/rust-toolchain@nightly + uses: dtolnay/rust-toolchain@stable with: components: rustfmt - name: Checkout diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3812f70ec8..cbc8d423d3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -45,8 +45,6 @@ env UPDATE_EXPECT=1 cargo test 7. Make sure [rustfmt](https://github.com/rust-lang/rustfmt) and [clippy](https://github.com/rust-lang/rust-clippy) don't complain about your changes. -We use the `nightly` channel for `rustfmt` so please set the appropriate settings for your editor/IDE for that. - ## Create a Pull Request 1. Ensure that you updated the documentation and filled the [Pull Request template](./.github/PULL_REQUEST_TEMPLATE.md) according to the changes you made. diff --git a/git-cliff-core/src/changelog.rs b/git-cliff-core/src/changelog.rs index a505a127a5..a53abc8b23 100644 --- a/git-cliff-core/src/changelog.rs +++ b/git-cliff-core/src/changelog.rs @@ -1,13 +1,7 @@ use crate::commit::Commit; -use crate::config::{ - Config, - GitConfig, -}; +use crate::config::{Config, GitConfig}; use crate::error::Result; -use crate::release::{ - Release, - Releases, -}; +use crate::release::{Release, Releases}; #[cfg(feature = "bitbucket")] use crate::remote::bitbucket::BitbucketClient; #[cfg(feature = "gitea")] @@ -18,644 +12,600 @@ use crate::remote::github::GitHubClient; use crate::remote::gitlab::GitLabClient; use crate::template::Template; use std::collections::HashMap; -use std::io::{ - Read, - Write, -}; -use std::time::{ - SystemTime, - UNIX_EPOCH, -}; +use std::io::{Read, Write}; +use std::time::{SystemTime, UNIX_EPOCH}; /// Changelog generator. #[derive(Debug)] pub struct Changelog<'a> { - /// Releases that the changelog will contain. - pub releases: Vec>, - header_template: Option