test suite reviews and discussions
 help / color / mirror / Atom feed
From: ohilyard@iol.unh.edu
To: dts@dpdk.org
Cc: lijuan.tu@intel.com, Owen Hilyard <ohilyard@iol.unh.edu>
Subject: [PATCH v1] ci/check_formatting: Added a script to check formatting
Date: Thu, 31 Mar 2022 16:37:44 -0400
Message-ID: <20220331203743.14365-1-ohilyard@iol.unh.edu> (raw)

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

diff --git a/ci/README.md b/ci/README.md
new file mode 100644
index 00000000..00f12e9b
--- /dev/null
+++ b/ci/README.md
@@ -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.
diff --git a/ci/check_formatting.sh b/ci/check_formatting.sh
new file mode 100755
index 00000000..87a07f68
--- /dev/null
+++ b/ci/check_formatting.sh
@@ -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
-- 
2.30.2


             reply	other threads:[~2022-03-31 20:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-31 20:37 ohilyard [this message]
2022-04-06 12:48 ` lijuan.tu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220331203743.14365-1-ohilyard@iol.unh.edu \
    --to=ohilyard@iol.unh.edu \
    --cc=dts@dpdk.org \
    --cc=lijuan.tu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

test suite reviews and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dts/0 dts/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dts dts/ https://inbox.dpdk.org/dts \
		dts@dpdk.org
	public-inbox-index dts

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dts


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git