[v1] ci/check_formatting: Added a script to check formatting
Checks
Context |
Check |
Description |
ci/Intel-dts-suite-test |
warning
|
SKIPPED
|
Commit Message
From: Owen Hilyard <ohilyard@iol.unh.edu>
The script should be run from the repository root. It will exit with
exit code 0 if everything is properly formatted. It will exit with exit
code 1 if formatting happened. It will also print a git shortstat diff,
which will display all of the incorrectly formatted files.
Signed-off-by: Owen Hilyard <ohilyard@iol.unh.edu>
---
ci/README.md | 10 ++++++++++
ci/check_formatting.sh | 13 +++++++++++++
2 files changed, 23 insertions(+)
create mode 100644 ci/README.md
create mode 100755 ci/check_formatting.sh
Comments
On Thu, 31 Mar 2022 16:37:44 -0400, ohilyard@iol.unh.edu wrote:
> From: Owen Hilyard <ohilyard@iol.unh.edu>
>
> The script should be run from the repository root. It will exit with
> exit code 0 if everything is properly formatted. It will exit with exit
> code 1 if formatting happened. It will also print a git shortstat diff,
> which will display all of the incorrectly formatted files.
>
> Signed-off-by: Owen Hilyard <ohilyard@iol.unh.edu>
Applied, thanks
new file mode 100644
@@ -0,0 +1,10 @@
+# Introduction
+
+This directory and all subdirectories contain scripts and
+configuration related to performing CI for DTS. It may be safely
+ignored by anyone who is not attempting to perform CI for DTS.
+
+## Running
+
+All the scripts in this directory or any of its subdirectories
+are expected to be run from the repository root.
new file mode 100755
@@ -0,0 +1,13 @@
+#!/usr/bin/env bash
+
+./format.sh
+
+if [ -n "$(git diff --shortstat)" ]; then
+ echo "Formatting: FAIL"
+ echo "Improperly formatted files found, run <dts root>/format.sh and re-submit your patch."
+ git diff --stat
+ exit 1
+else
+ echo "Formatting: PASS"
+ exit 0
+fi
\ No newline at end of file