mirror of
https://github.com/containers/youki
synced 2024-09-19 10:21:46 +02:00
Add rustfmt.toml to standardize formatting
Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
This commit is contained in:
parent
25edc95648
commit
bdd4f5c674
4
.github/workflows/basic.yml
vendored
4
.github/workflows/basic.yml
vendored
@ -44,7 +44,9 @@ jobs:
|
|||||||
- name: Setup Rust toolchain and cache
|
- name: Setup Rust toolchain and cache
|
||||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
with:
|
with:
|
||||||
components: rustfmt, clippy
|
components: clippy
|
||||||
|
- name: Install nightly rustfmt
|
||||||
|
run: rustup toolchain install nightly --component rustfmt --profile minimal --no-self-update
|
||||||
- name: typos-action
|
- name: typos-action
|
||||||
uses: crate-ci/typos@v1.14.12
|
uses: crate-ci/typos@v1.14.12
|
||||||
- name: Install just
|
- name: Install just
|
||||||
|
6
rustfmt.toml
Normal file
6
rustfmt.toml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
newline_style = "Native"
|
||||||
|
unstable_features = true # Cargo fmt now needs to be called with `cargo +nightly fmt`
|
||||||
|
group_imports = "StdExternalCrate" # create three groups for std, external and local crates
|
||||||
|
# Merge imports from the same module
|
||||||
|
# See: https://rust-lang.github.io/rustfmt/?version=v1.4.38&search=#imports_granularity
|
||||||
|
imports_granularity = "Module"
|
@ -48,6 +48,9 @@ if [ "$1" == "fmt" ]; then
|
|||||||
# running cargo fmt fails when run through cross
|
# running cargo fmt fails when run through cross
|
||||||
# also cargo fmt is platform independent
|
# also cargo fmt is platform independent
|
||||||
CARGO="cargo"
|
CARGO="cargo"
|
||||||
|
|
||||||
|
# Use nightly for `cargo fmt` as `rustfmt.toml` uses unstable features.
|
||||||
|
set -- "+nightly" "$@"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$CARGO" == "cross" ]; then
|
if [ "$CARGO" == "cross" ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user