Add format test to CI

To enforce uniformity for all PRs, the CI checks if the code
is formatted rigth using `cargo fmt` tool.

Signed-off-by: Costin-Robert Sin <sin.costinrobert@gmail.com>
This commit is contained in:
Costin-Robert Sin 2022-06-19 15:28:40 +03:00
parent b6df05d63e
commit 8f08a69c28
3 changed files with 10 additions and 0 deletions

View File

@ -320,3 +320,11 @@ task:
check_script:
- cargo check
before_cache_script: rm -rf $CARGO_HOME/registry/index
# Tasks that checks if the code is formatted right using `cargo fmt` tool
task:
name: Rust Formatter
container:
image: rust:latest
setup_script: rustup +$TOOLCHAIN component add rustfmt
test_script: $TOOL +$TOOLCHAIN fmt --all -- --check

View File

@ -33,6 +33,7 @@ status = [
"OpenBSD x86_64",
"Redox x86_64",
"Rust Stable",
"Rust Formatter",
"iOS aarch64",
"iOS x86_64",
"Illumos",

1
rustfmt.toml Normal file
View File

@ -0,0 +1 @@
max_width = 80