Commit graph

7 commits

Author SHA1 Message Date
Dennis Kempin
ccb9014afb Deprecate old dev tooling scripts
All of the developer tooling has moved to ./tools to make them
easier to discover.

BUG=None
TEST=None

Change-Id: I4daf6a0ca08c94a0c35ce8bc52f9d86e4cb15de9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3251781
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2021-11-02 22:23:03 +00:00
Dennis Kempin
ee56b2ddec Add presubmit script
Consolidates the utility scripts from bin/ into tools/.
Adds a 'presubmit' utility script to run a set of checks and
tests.

This won't be a git hook, but can be manually used to verify
changes before uploading.

BUG=b:199951064
TEST=./tools/presubmit --quick
./tools/dev_container ./tools/presubmit

Change-Id: Iac7c11fca0beaa6d4f214319149ef385fa5ced70
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3225139
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2021-10-18 20:10:41 +00:00
Dylan Reid
7e24a8e759 bin/fmt: Set rustfmt edition to 2018
The default is 2015 and that causes any usage of `async` to cause kokoro
errors.

Change-Id: I9f962b6f578b0d1992377dfefdd724c080a6f1b5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2024365
Reviewed-by: Stephen Barber <smbarber@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Tested-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Dylan Reid <dgreid@chromium.org>
2020-02-05 09:00:27 +00:00
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