Silence annoying rustfmt config warnings (#1508)

Silence those [annoying rustfmt config warnings](https://github.com/bevyengine/bevy/pull/1499/checks?check_run_id=1950282111#step:5:66) that happen because we have unstable rustfmt options in `rustfmt.toml`, but we run it in stable on CI.  Thanks to @Ratysz for [calling it out](https://github.com/bevyengine/bevy/pull/1499#issuecomment-783190586). 😄 

The final approach we settled on was to comment out the unstable options in `rustfmt.toml`.  Those who are using `nightly` may  uncomment the unstable options locally if they wish. Once the options stabilize, we can uncomment them again.

We also decided that instead of fixing the alias, we would remove the alias entirely so that we do not introduce a custom `.cargo/config.toml` that would conflict with users' custom version of the same file. This means that instead of using a `cargo ci` alias you should use `cargo run -p ci` or `cargo run --package ci` instead.

<details><summary>Original Approach (abandoned)</summary>
<p>

_We decided **not** to go this way..._

In my quest to find a portable way to filter out the warnings I switched the library used to execute commands from `xshell` to `duct` (as advised by the `xshell` project itself when you want to do less simple things).  This still uses the "xtask" pattern of using a cargo command alias and a rust project for what would have usually been done with a bash script (on posix), just a different helper library is being used internally.

NOTE 1: Also, thanks to some sleuthing by @DJMcNab we were able to fix the broken cargo alias.  The issue turned out to be that `.cargo/config.toml` was being ignored because of `.gitignore`.

NOTE 2: This is a [known breaking change](https://github.com/bevyengine/bevy/pull/1309#discussion_r564023753) for anyone working on bevy who has their own local `.cargo/config.toml`.
</p>
</details>
This commit is contained in:
Nathan Stocks 2021-03-07 19:50:17 +00:00
parent dabf419095
commit 891f6a1f48
2 changed files with 7 additions and 4 deletions

View file

@ -35,7 +35,7 @@ jobs:
- name: Check the format
# See tools/ci/src/main.rs for the commands this runs
run: cargo run --package ci
run: cargo run -p ci
if: runner.os == 'linux' && matrix.toolchain == 'stable'
- name: Build & run tests

View file

@ -1,5 +1,8 @@
unstable_features = true
imports_granularity = "Crate"
use_field_init_shorthand = true
reorder_impl_items = true
newline_style = "Unix"
# The following lines may be uncommented on nightly Rust.
# Once these features have stabilized, they should be added to the always-enabled options above.
#unstable_features = true
#imports_granularity = "Crate"
#reorder_impl_items = true