Check the result of formatting the code
The old format-code.sh script used to run git diff to determine if any
files had been reformatted in the commit. The "new" way should do the
same.
Tested:
Ran a build on entity-manager, which includes a custom format-code
script, and saw the build pass. Backed up to the commit prior, which
included formatting violations, reran and saw the build fail.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I3697da5dbbe78bb2241bb66d2583b2c9c2f9e753
diff --git a/scripts/unit-test.py b/scripts/unit-test.py
index d8c4712..6f15960 100755
--- a/scripts/unit-test.py
+++ b/scripts/unit-test.py
@@ -1225,6 +1225,10 @@
for f in format_scripts:
check_call_cmd(f, CODE_SCAN_DIR)
+ # Check to see if any files changed
+ check_call_cmd("git", "-C", CODE_SCAN_DIR,
+ "--no-pager", "diff", "--exit-code")
+
# Check if this repo has a supported make infrastructure
pkg = Package(UNIT_TEST_PKG, CODE_SCAN_DIR)
if not pkg.build_system():