Commit graph

4 commits

Author SHA1 Message Date
Daniel Verkamp
3530f2a2bb bin/fmt: ignore generated files in target dir
Don't check formatting for *.rs files generated by the protobuf code
generator.

BUG=None
TEST=bin/fmt --check
TEST=docker/wrapped_smoke_test.sh

Change-Id: I74af762d2758e6106a855f27214646b51f640b11
Signed-off-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1876838
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Stephen Barber <smbarber@chromium.org>
2019-10-25 23:54:14 +00:00
Daniel Verkamp
1769b63686 bin/fmt: remove use of cargo fmt
This simplifies our formatting script so that it does not need any of
the Cargo metadata to run; the new version just finds all Rust files
(*.rs) and runs `rustfmt` on them individually.

BUG=None
TEST=bin/fmt
TEST=bin/fmt --check

Change-Id: I45aaee497d4f1dfcc03b3e2c5c2f27feb974dc80
Signed-off-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1865371
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
2019-10-21 19:26:04 +00:00
Jakub Staron
4197d3a3a1 crosvm: add license blurb to bin/clippy and bin/fmt files
bin/clippy and bin/fmt were missing license blurbs at the top,
so update them to include the license blurbs.

BUG=None
TEST=None

Change-Id: Ic6bb5af3885d3735dcad42614aff7ac3dd33d638
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1646736
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Jakub Staroń <jstaron@google.com>
Reviewed-by: Stephen Barber <smbarber@chromium.org>
2019-06-08 04:27:35 +00:00
David Tolnay
18ce5713e6 bin: Add script to run rustfmt against all workspaces
Add a script to run `cargo fmt` on all Rust code contained in crosvm.
This is different from `cargo fmt --all` which formats multiple crates
but a single workspace only. Crosvm consists of multiple workspaces.

Usage:

    $ bin/fmt

To print a diff and exit 1 if code is not formatted, but without
changing any files, use:

    $ bin/fmt --check

TEST=those commands
TEST=local kokoro

Change-Id: I4194509ad3a1bbc829c4b1069d54d940b927113b
Reviewed-on: https://chromium-review.googlesource.com/1477498
Commit-Ready: David Tolnay <dtolnay@chromium.org>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Zach Reizner <zachr@chromium.org>
2019-02-21 06:29:42 -08:00