mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-10 12:09:31 +00:00
The updated health-check will by default only run on modified files. If you do not make changes to python code, python checks won't run, etc. The script also simplifies the writing of those checks so we can start adding more of them. Luci will be updated to make use of the --list-checks function to run each check in a separate luci step. In the meantime, we keep a compatibility layer to translate the old arguments to the new style. BUG=b:239255137 TEST=./tools/health-check in all it's variations Change-Id: I21b986b46c7cfccf3d13f4c76bbd3d0ec7240c26 Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3827174 Tested-by: Dennis Kempin <denniskempin@google.com> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Commit-Queue: Dennis Kempin <denniskempin@google.com>
37 lines
839 B
Python
Executable file
37 lines
839 B
Python
Executable file
#!/usr/bin/env python3
|
|
# Copyright 2022 The Chromium OS Authors. All rights reserved.
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
|
|
# Run `rustfmt` on all Rust code contained in the crosvm workspace, including
|
|
# all commmon/* crates as well.
|
|
#
|
|
# Usage:
|
|
#
|
|
# $ bin/fmt
|
|
#
|
|
# To print a diff and exit 1 if code is not formatted, but without changing any
|
|
# files, use:
|
|
#
|
|
# $ bin/fmt --check
|
|
#
|
|
|
|
from impl.common import (
|
|
CROSVM_ROOT,
|
|
run_main,
|
|
cmd,
|
|
chdir,
|
|
)
|
|
|
|
|
|
def main(check: bool = False, nightly: bool = False):
|
|
chdir(CROSVM_ROOT)
|
|
cmd(
|
|
"./tools/health-check --all rust_format python_format markdown_format",
|
|
"--fix" if not check else None,
|
|
"--nightly" if nightly else None,
|
|
).fg()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
run_main(main)
|