From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2FCDAA0507; Thu, 31 Mar 2022 22:37:58 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 05990410F3; Thu, 31 Mar 2022 22:37:58 +0200 (CEST) Received: from mail-vs1-f100.google.com (mail-vs1-f100.google.com [209.85.217.100]) by mails.dpdk.org (Postfix) with ESMTP id C53694014F for ; Thu, 31 Mar 2022 22:37:56 +0200 (CEST) Received: by mail-vs1-f100.google.com with SMTP id z134so723729vsz.8 for ; Thu, 31 Mar 2022 13:37:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=vloBnSAsb7Gi0DLSvAZ0S+dwRdEBH7fXjRa4Ts212Kg=; b=XgWk3ZR6fRbSyQL1LIS4oWMEmUbUWSWs24NjztSrm6Oo0fP7pcBcu1jmsAiB1i9yHH bQvudw2r6JaLQFXlS8Wc+VsNnP+CWT9y9GTMpalFCNzwhvN+9Ejrc3AoUZ+ZnUudI7RT 1FkrVNKW/+lxRfSiklB37mRdAAWRYgo7L01+U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=vloBnSAsb7Gi0DLSvAZ0S+dwRdEBH7fXjRa4Ts212Kg=; b=rNRqKEbSaRPEUp1uVtwhZNRYJ+M+tKVc8nImiZPF3t+MFA2SM6MmTtD3FumQ6ZM2dE sG4J4XHxyqD7tdc7IGQVyduQsJAEt0YhuYBXS1+NXTTqt7z1/E3eCGGYys0p9ir5GB1R 7EDa/hLLlJn0Fw5+gaomUQUBsPjykCLtGktDvyjhoqQY22RpKslHwOj/4n9s5yE1bnq5 ZtJbUytxk9y39MMN0lzDmrw0bG6tdpotuuoNQ8FuUeDQ6iAc9DxjJwe5Sraq7ZV3XUzL /yogviGfwUKk/yvt2jV4nDjAM7UWSE0HAHkXAMO5ctZ+L4avXFUOgkTbnxVIgxv13jGF 8Fug== X-Gm-Message-State: AOAM5309Lo9fMhYOzjMw4x9UwJ4wTQaWtD1t2Ky46WzNeD7ic8fnGndk 5T6FVx34KDuSV3pnz8xv7O8gJote80wOvhAKBt/c6fZmzPspfbnbhjnPJ8oxFIoxQj3Jq6/vszE xxt8O/+eicuclQNvSHzRH3XBmFNORlTD7MkDoFfYVFTL6rys3gBgqXGA2FLPCfoD9LRq/Cw+CTw == X-Google-Smtp-Source: ABdhPJzby95/9WlVyd3fUGJHN6WFrBICubz5/Pea2wStWevZdB0ZBr5AtsPeBtmoq/jovg8LqDV7GYJFAUG2 X-Received: by 2002:a67:c894:0:b0:324:c5da:a9b5 with SMTP id v20-20020a67c894000000b00324c5daa9b5mr2474268vsk.33.1648759076112; Thu, 31 Mar 2022 13:37:56 -0700 (PDT) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [132.177.123.84]) by smtp-relay.gmail.com with ESMTPS id l4-20020a0561023f4400b003229bcfb9bfsm29473vsv.3.2022.03.31.13.37.56 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 Mar 2022 13:37:56 -0700 (PDT) X-Relaying-Domain: iol.unh.edu Received: from iol.unh.edu (unknown [IPv6:2606:4100:3880:1257::105d]) by postal.iol.unh.edu (Postfix) with ESMTP id B2FFA605183A; Thu, 31 Mar 2022 16:37:55 -0400 (EDT) From: ohilyard@iol.unh.edu To: dts@dpdk.org Cc: lijuan.tu@intel.com, Owen Hilyard 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> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org From: Owen Hilyard 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 --- 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 /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