git/ci
Patrick Steinhardt e75cd05900 ci: check formatting of our Rust code
Introduce a CI check that verifies that our Rust code is well-formatted.
This check uses `cargo fmt`, which is a wrapper around rustfmt(1) that
executes formatting for all Rust source files. rustfmt(1) itself is the
de-facto standard for formatting code in the Rust ecosystem.

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.

The implemented script looks somewhat weird as we perfom manual error
handling instead of using something like `set -e`. The intent here is
that subsequent commits will add more checks, and we want to execute all
of these checks regardless of whether or not a previous check failed.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-10-15 08:10:17 -07:00
..
config ci: deprecate ci/config/allow-ref script 2023-08-30 15:56:11 -07:00
util
check-directional-formatting.bash ci: unify bash calling convention 2024-07-08 16:23:05 -07:00
check-unsafe-assertions.sh ci: add build checking for side-effects in assert() calls 2025-03-21 03:32:04 -07:00
check-whitespace.sh check-whitespace: detect if no base_commit is provided 2024-07-23 09:56:50 -07:00
install-dependencies.sh ci: check formatting of our Rust code 2025-10-15 08:10:17 -07:00
install-sdk.ps1 ci: create script to set up Git for Windows SDK 2024-10-09 11:33:04 -07:00
lib.sh ci: exercise credential helpers 2025-02-20 07:49:52 -08:00
make-test-artifacts.sh
mount-fileshare.sh
print-test-failures.sh ci: allow github-actions print test failures again 2025-07-16 14:09:51 -07:00
run-build-and-minimal-fuzzers.sh fuzz: port fuzz-url-decode-mem from OSS-Fuzz 2024-10-16 18:14:11 -04:00
run-build-and-tests.sh Merge branch 'ps/rust-balloon' into ps/ci-rust 2025-10-07 10:55:39 -07:00
run-rust-checks.sh ci: check formatting of our Rust code 2025-10-15 08:10:17 -07:00
run-static-analysis.sh Merge branch 'kn/meson-hdr-check' 2025-05-05 14:56:25 -07:00
run-style-check.sh clang-format: add 'RemoveBracesLLVM' to the main config 2025-07-02 09:05:29 -07:00
run-test-slice.sh ci: stop linking the `prove` cache 2025-05-05 14:15:19 -07:00
test-documentation.sh ci: don't compile whole project when testing docs with Meson 2025-09-11 09:57:25 -07:00