git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "SZEDER Gábor" <szeder.dev@gmail.com>
To: Patrick Steinhardt <ps@pks.im>
Cc: git@vger.kernel.org, Ezekiel Newren <ezekielnewren@gmail.com>,
	"brian m. carlson" <sandals@crustytoothpaste.net>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>
Subject: Re: [PATCH 2/6] ci: check formatting of our Rust code
Date: Wed, 8 Oct 2025 22:55:43 +0200	[thread overview]
Message-ID: <aObPzzLtZzodZf+Q@szeder.dev> (raw)
In-Reply-To: <20251007-b4-pks-ci-rust-v1-2-394502abe7ea@pks.im>

On Tue, Oct 07, 2025 at 02:36:30PM +0200, Patrick Steinhardt wrote:
> Introduce a CI check that verifies that our Rust code is well-formatted.
> This check uses rustfmt(1), which is the de-facto standard in the Rust
> world.
> 
> The rustfmt(1) tool allows to tweak the final format in theory. In
> practice though, the Rust ecosystem has aligned on style "editions".
> These editions only exist to ensure that any potential changes to the
> style don't cause reformats to existing code bases. Other than that,
> most Rust projects out there accept this default style of a specific
> edition.
> 
> Let's do the same and use that default style. It may not be anyone's
> favorite, but it is consistent and by making it part of our CI we also
> enforce it right from the start.
> 
> Note that we don't have to pick a specific style edition here, as the
> edition is automatically derived from the edition we have specified in
> our "Cargo.toml" file.
> 
> Signed-off-by: Patrick Steinhardt <ps@pks.im>
> ---

> diff --git a/ci/run-rust-checks.sh b/ci/run-rust-checks.sh
> new file mode 100755
> index 0000000000..082eb52f11
> --- /dev/null
> +++ b/ci/run-rust-checks.sh
> @@ -0,0 +1,12 @@
> +#!/bin/sh
> +
> +. ${0%/*}/lib.sh
> +
> +set +x
> +
> +if ! group "Check Rust formatting" cargo fmt --all --check
> +then
> +	RET=1
> +fi
> +
> +exit $RET

Our ci/*.sh scripts usually rely on 'set -e' to catch failed commands.
Either this script should follow that convention as well, or the
commit message should justify the deviation from convention.


  parent reply	other threads:[~2025-10-08 20:55 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-07 12:36 [PATCH 0/6] ci: improvements to our Rust infrastructure Patrick Steinhardt
2025-10-07 12:36 ` [PATCH 1/6] ci: deduplicate calls to `apt-get update` Patrick Steinhardt
2025-10-07 12:54   ` Karthik Nayak
2025-10-14 20:56   ` Justin Tobler
2025-10-07 12:36 ` [PATCH 2/6] ci: check formatting of our Rust code Patrick Steinhardt
2025-10-07 13:04   ` Karthik Nayak
2025-10-07 13:50     ` Patrick Steinhardt
2025-10-07 17:13   ` Eric Sunshine
2025-10-07 17:38     ` Junio C Hamano
2025-10-07 18:03       ` Eric Sunshine
2025-10-07 22:42     ` brian m. carlson
2025-10-07 22:58       ` Chris Torek
2025-10-08  4:46       ` Patrick Steinhardt
2025-10-08 15:34         ` Junio C Hamano
2025-10-09  5:29           ` Patrick Steinhardt
2025-10-29 22:54           ` SZEDER Gábor
2025-10-07 22:07   ` brian m. carlson
2025-10-08 20:55   ` SZEDER Gábor [this message]
2025-10-09  5:29     ` Patrick Steinhardt
2025-10-29 21:19       ` SZEDER Gábor
2025-10-07 12:36 ` [PATCH 3/6] rust/varint: add safety comments Patrick Steinhardt
2025-10-08  0:29   ` brian m. carlson
2025-10-08  4:46     ` Patrick Steinhardt
2025-10-07 12:36 ` [PATCH 4/6] ci: check for common Rust mistakes via Clippy Patrick Steinhardt
2025-10-07 12:36 ` [PATCH 5/6] ci: verify minimum supported Rust version Patrick Steinhardt
2025-10-07 12:36 ` [PATCH 6/6] rust: support for Windows Patrick Steinhardt
2025-10-15  6:04 ` [PATCH v3 0/6] ci: improvements to our Rust infrastructure Patrick Steinhardt
2025-10-15  6:04   ` [PATCH v3 1/6] ci: deduplicate calls to `apt-get update` Patrick Steinhardt
2025-10-15  6:04   ` [PATCH v3 2/6] ci: check formatting of our Rust code Patrick Steinhardt
2025-10-15  6:04   ` [PATCH v3 3/6] rust/varint: add safety comments Patrick Steinhardt
2025-10-15  6:04   ` [PATCH v3 4/6] ci: check for common Rust mistakes via Clippy Patrick Steinhardt
2025-10-15  6:04   ` [PATCH v3 5/6] ci: verify minimum supported Rust version Patrick Steinhardt
2025-10-15  6:04   ` [PATCH v3 6/6] rust: support for Windows Patrick Steinhardt
2025-11-20 19:45     ` Ezekiel Newren
2025-11-21  8:18       ` Johannes Schindelin
2025-11-21 21:39         ` Junio C Hamano
2025-10-15 15:21   ` [PATCH v3 0/6] ci: improvements to our Rust infrastructure Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aObPzzLtZzodZf+Q@szeder.dev \
    --to=szeder.dev@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=ezekielnewren@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=ps@pks.im \
    --cc=sandals@crustytoothpaste.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).