Skip to content

Commit

Permalink
Add format test to CI
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
costinsin committed Jun 21, 2022
1 parent b6df05d commit ffaf9f9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 component add rustfmt
test_script: $TOOL +$TOOLCHAIN fmt --all -- --check
1 change: 1 addition & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
max_width = 80

0 comments on commit ffaf9f9

Please sign in to comment.