From patchwork Wed Aug 19 16:20:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 52559 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by patches.linaro.org (Postfix) with ESMTPS id 0B61B20AF6 for ; Wed, 19 Aug 2015 16:21:47 +0000 (UTC) Received: by lbbpd10 with SMTP id pd10sf2989218lbb.3 for ; Wed, 19 Aug 2015 09:21:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:in-reply-to:references:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :mime-version:content-type:content-transfer-encoding:errors-to :sender:x-original-sender:x-original-authentication-results :mailing-list; bh=MhA/YGfn3XmeVC7Uy3v5QDF/HCX8AF8GIivNEwiprq0=; b=E8xKE3rttjBT8qP6t1s1LcgHjeOfns+286bTlVZEHLkLKBrNYLoWBHRUTFZS9AVs4d +ehqiR1tNFQu/dNdMtFXAYML+6SqvIb7XGgKG8QVIADQcsimfSPdCu39tUFvCZFs4MZ1 Us2rL7Ziy212hEQ/lE64oFDv5pfoRI37tGjNIQC9CZM9k5BKRkf6Ga31fCVDseWQDlS9 Gf18FIiBX+mU2MrdBvRjs01skQbIBt7XtstBpivuWCCUB39ZyU8euKN8Bo+YVUf5pkBK SGLTlx9PI5WMxJktTP55rX+y/RG7s3BjiYojIMTKazDf47CgFFDGQvOKpf3sNKMASd0N Dywg== X-Gm-Message-State: ALoCoQl3nbI3zUb9Pjb3coWwk1/3SW/cQcP6FM186trG2Kn5e2wAc1Ge0bYCSE9Gi86ba0nYCY6u X-Received: by 10.112.172.70 with SMTP id ba6mr3488349lbc.1.1440001306015; Wed, 19 Aug 2015 09:21:46 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.43.110 with SMTP id v14ls48308lal.19.gmail; Wed, 19 Aug 2015 09:21:45 -0700 (PDT) X-Received: by 10.112.138.199 with SMTP id qs7mr11778381lbb.21.1440001305861; Wed, 19 Aug 2015 09:21:45 -0700 (PDT) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id b9si845253lbc.161.2015.08.19.09.21.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Aug 2015 09:21:45 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by lbbpu9 with SMTP id pu9so6720531lbb.3 for ; Wed, 19 Aug 2015 09:21:45 -0700 (PDT) X-Received: by 10.112.126.101 with SMTP id mx5mr12134058lbb.35.1440001305762; Wed, 19 Aug 2015 09:21:45 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.162.200 with SMTP id yc8csp478537lbb; Wed, 19 Aug 2015 09:21:44 -0700 (PDT) X-Received: by 10.140.151.214 with SMTP id 205mr25525795qhx.91.1440001304356; Wed, 19 Aug 2015 09:21:44 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 140si1854072qhx.55.2015.08.19.09.21.43; Wed, 19 Aug 2015 09:21:44 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Received: by lists.linaro.org (Postfix, from userid 109) id 8D1FF61FE4; Wed, 19 Aug 2015 16:21:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 4E1B661FCB; Wed, 19 Aug 2015 16:20:52 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 2B3A461F6E; Wed, 19 Aug 2015 16:20:46 +0000 (UTC) Received: from mail-qk0-f171.google.com (mail-qk0-f171.google.com [209.85.220.171]) by lists.linaro.org (Postfix) with ESMTPS id DBE9061E84 for ; Wed, 19 Aug 2015 16:20:44 +0000 (UTC) Received: by qkcv6 with SMTP id v6so4055471qkc.0 for ; Wed, 19 Aug 2015 09:20:44 -0700 (PDT) X-Received: by 10.55.221.25 with SMTP id n25mr2047293qki.67.1440001244688; Wed, 19 Aug 2015 09:20:44 -0700 (PDT) Received: from localhost.localdomain (c-98-221-136-245.hsd1.nj.comcast.net. [98.221.136.245]) by smtp.gmail.com with ESMTPSA id r10sm599368qkr.48.2015.08.19.09.20.43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 19 Aug 2015 09:20:44 -0700 (PDT) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Wed, 19 Aug 2015 12:20:29 -0400 Message-Id: <1440001229-22483-3-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1440001229-22483-1-git-send-email-mike.holmes@linaro.org> References: <1440001229-22483-1-git-send-email-mike.holmes@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH 3/3] scripts: add odp_format to match chekpatch style X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: mike.holmes@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 This odp_format script applies source file formatting to match the ODP checkpatch style Signed-off-by: Mike Holmes --- scripts/odp_format | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 scripts/odp_format diff --git a/scripts/odp_format b/scripts/odp_format new file mode 100755 index 0000000..192e63d --- /dev/null +++ b/scripts/odp_format @@ -0,0 +1,31 @@ +#!/bin/bash +# This script is a clean up tool for the ODP project source files. +# It will replace the src files with versions that are formatted to match the +# checkpatch rules for ODP. + +set -e + +CLANG_FORMAT=clang-format-3.6 + +if ! type $CLANG_FORMAT >/dev/null ; then + echo "Require $CLANG_FORMAT" + echo "try apt-get install $CLANG_FORMAT" + exit +fi + +if [[ $# -eq 0 ]] +then + echo "No source file paths supplied" + exit +fi + +#work on specified files +while (( "$#" )); do + echo $1 + clang-format-3.6 -i -style=file $1 + #as of version 3.6 a few corner cases slip though so use sed + #to fix them bacasue it uses space where checkpatch wants a tab + sed -i 's/^ /\t/' $1 + sed -i 's/\\ /\\\t/' $1 + shift +done