2023-10-04 21:50:44 -04:00
|
|
|
#!/bin/bash
|
2023-10-04 01:26:15 -04:00
|
|
|
|
|
|
|
args="--emit stdout --edition 2021 --color never"
|
|
|
|
|
2023-10-04 21:50:44 -04:00
|
|
|
for cfg in rustfmt.toml .rustfmt.toml rustfmt.nightly.toml .rustfmt.nightly.toml rustfmt-nightly.toml .rustfmt-nightly.toml
|
|
|
|
do
|
|
|
|
[ "$cfg" == "rustfmt.nightly.toml" ] && args="+nightly $args"
|
|
|
|
[ -f $cfg ] && exec rustfmt $args --config-path $cfg
|
|
|
|
done
|
|
|
|
|
|
|
|
# or if no files, fallback to my preferred format
|
|
|
|
exec rustfmt $args --config imports_granularity=crate
|