summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2021-11-01 21:14:51 -0600
committerCommit Bot <commit-bot@chromium.org>2021-11-03 02:17:46 +0000
commitdbf6eb07095e080246f093a3733b48f9fd3e4d4b (patch)
treef25b1cc04e5e48ac8a05d258788adda1124c9504
parent11a90677c5501bf28f5964f782f4d11e565dfb75 (diff)
downloadchrome-ec-dbf6eb07095e080246f093a3733b48f9fd3e4d4b.tar.gz
zephyr: Validate BUILD.py files are formatted with black in CQ
Check that "black" was run on BUILD.py files in the firmware_builder.py script. BUG=b:193815337 BRANCH=none TEST=firmware_builder.py --metrics=/dev/null test Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I51666167adc9d088601732a067ce36a6f53c8e1a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3256038 Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
-rwxr-xr-xzephyr/firmware_builder.py4
-rw-r--r--zephyr/projects/corsola/krabby/BUILD.py3
2 files changed, 6 insertions, 1 deletions
diff --git a/zephyr/firmware_builder.py b/zephyr/firmware_builder.py
index d04941f752..22d882094b 100755
--- a/zephyr/firmware_builder.py
+++ b/zephyr/firmware_builder.py
@@ -133,6 +133,10 @@ def test(opts):
# proceeding.
subprocess.run([zephyr_dir / 'zmake' / 'run_tests.sh'], check=True)
+ # Run formatting checks on all BUILD.py files.
+ config_files = zephyr_dir.rglob("**/BUILD.py")
+ subprocess.run(["black", "--diff", "--check", *config_files], check=True)
+
subprocess.run(['zmake', '-D', 'testall'], check=True)
# Run the test with coverage also, as sometimes they behave differently.
diff --git a/zephyr/projects/corsola/krabby/BUILD.py b/zephyr/projects/corsola/krabby/BUILD.py
index 84ba72bdf7..e533544d8c 100644
--- a/zephyr/projects/corsola/krabby/BUILD.py
+++ b/zephyr/projects/corsola/krabby/BUILD.py
@@ -11,5 +11,6 @@ register_binman_project(
"gpio.dts",
"i2c.dts",
"motionsense.dts",
- "pwm.dts"],
+ "pwm.dts",
+ ],
)