From f3da089361835d98f405aafdf39880a2a84d6541 Mon Sep 17 00:00:00 2001 From: Costin-Robert Sin Date: Sun, 19 Jun 2022 15:28:40 +0300 Subject: [PATCH] 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 --- .cirrus.yml | 8 ++++++++ rustfmt.toml | 1 + 2 files changed, 9 insertions(+) create mode 100644 rustfmt.toml diff --git a/.cirrus.yml b/.cirrus.yml index ae184f86e4..ee150f1931 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -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 \ No newline at end of file diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 0000000000..5c8d9318b3 --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1 @@ +max_width = 80 \ No newline at end of file