Commit graph

6 commits

Author SHA1 Message Date
Kaiyi Li
413c388d5e rustfmt: wrap comments
Tests: presubmit
Change-Id: Ie759b0b788440986783f3b7de4eeca8d5ceeaa92
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5297986
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Kaiyi Li <kaiyili@google.com>
2024-02-15 23:30:13 +00:00
Dennis Kempin
a5b5e4b9a6 Enable rustfmt nightly in container and CI
This enables nightly rustfmt features in CI so we can keep a consistent
imports style.

The resulting formatting changes are in the follow-up CL and will
need to submit together.

This change also uncovered a bug from a previous commit that caused only
the first command in a series to be waited for. Formatting issues would
not be reported by the tool. The bug is fixed as part of this CL.

BUG=b:302055317
TEST=dev_container presubmit format --no-delta

Change-Id: I5d50609cc89d7e78bce66db120737a302f5c57e8
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4950268
Reviewed-by: Zihan Chen <zihanchen@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2023-11-29 18:41:29 +00:00
Kaiyi Li
f5f905590d rustfmt: add rules for imports
Tests: presubmit
Change-Id: I37a5ef640c27952d63023e881445240e8d50dbc4
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4889711
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Kaiyi Li <kaiyili@google.com>
2023-10-11 14:54:30 +00:00
Daniel Verkamp
8a4b2c448b rustfmt, win_util: update to 2021 edition
These are the only two places still using edition = 2018.

BUG=None
TEST=tools/fmt --check

Change-Id: I32577672d768db51ded66831089f135ffa77ea41
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3680641
Reviewed-by: Anton Romanov <romanton@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-05-31 23:35:02 +00:00
Keiichi Watanabe
c664ea24d5 rustfmt.toml: Use 2018 edition
rustfmt uses 2015 edition by default in which async functions cannot be
formatted well. So, we should specify 2018 explicitly.

BUG=none
TEST=cargo fmt

Change-Id: Iaa604c78d028c5abeaab87a62ea39ee65e8aae14
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2683937
Tested-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
2021-02-10 11:54:06 +00:00
Dylan Reid
9fbac2cf59 Add basic rustfmt config
Enable two optional features:
- Swapping try for '?'
- Shortening "name = name," to "name," in member initialization.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Change-Id: I8e29eb01f10451cd2a549a699de07f651cc4af0f
Reviewed-on: https://chromium-review.googlesource.com/1226224
Reviewed-by: Zach Reizner <zachr@chromium.org>
2018-09-15 20:58:19 -07:00