From patchwork Wed Feb 8 21:50:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 93647 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp4557obz; Wed, 8 Feb 2017 13:51:36 -0800 (PST) X-Received: by 10.55.91.197 with SMTP id p188mr23528185qkb.197.1486590696337; Wed, 08 Feb 2017 13:51:36 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id w1si6545314qta.213.2017.02.08.13.51.35; Wed, 08 Feb 2017 13:51:36 -0800 (PST) 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; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 9206562EA7; Wed, 8 Feb 2017 21:51:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id C454C62D47; Wed, 8 Feb 2017 21:51:26 +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 60C2662E9F; Wed, 8 Feb 2017 21:51:21 +0000 (UTC) Received: from mail-lf0-f49.google.com (mail-lf0-f49.google.com [209.85.215.49]) by lists.linaro.org (Postfix) with ESMTPS id AC4B960C25 for ; Wed, 8 Feb 2017 21:51:15 +0000 (UTC) Received: by mail-lf0-f49.google.com with SMTP id z134so90220915lff.3 for ; Wed, 08 Feb 2017 13:51:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=1PjU931+lx2rCMo7tAO0hHiyxKGlHEWtkqflOyV5Qgo=; b=rPZ9YVtZaY9g2z5ZJWi2TXoCiAUJSQN0IVAIthmqDflrEAPpvDMdB2BJAjpWQRtx+0 FhIxgCySudBdWHEG/Gnoxsv0KutgyIzD0f3mN7tsEq8yvjPQhAZFWXUXie973ucG+W39 hEIN+5ylDAZ0SJhPdEbDZOjkb0rO0dAAwE9DFvUr3WhxZUn1pW7sjh7rUt0ydQqbkbG7 nQQ0Kamw08oOB7P1jSML+m+s1ANte5CjnDpNK0sWDFsj5unreF/HYxuOXSGPFD5XYwsT lbTjTvgPR/Fpu80qoTjXbdNpYDoE4oUsbXI+wZ0Vqj65lGRXKIt8XuEoJsN8mwMi4AqD qh6w== X-Gm-Message-State: AIkVDXL/Fw18IlsMCEwyY87s5k4XfatCL4CGWXpzt+Mq3JyEcVPW/WTG3qPW8FFpuERn6kCEtWM= X-Received: by 10.46.69.139 with SMTP id s133mr9106495lja.56.1486590674076; Wed, 08 Feb 2017 13:51:14 -0800 (PST) Received: from localhost.localdomain (ppp109-252-7-40.pppoe.spdop.ru. [109.252.7.40]) by smtp.gmail.com with ESMTPSA id w4sm2828970ljd.23.2017.02.08.13.51.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Feb 2017 13:51:12 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Thu, 9 Feb 2017 00:50:53 +0300 Message-Id: <20170208215053.32544-1-maxim.uvarov@linaro.org> X-Mailer: git-send-email 2.11.0.295.gd7dffce Subject: [lng-odp] [PATCHv2] travis: add code style checks X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" run checkpatch.pl to check code style for applied patches. Do not check spelling now. Will check it only on merge requests. Signed-off-by: Maxim Uvarov --- v2: travis generates buggy $TRAVIS_COMMIT_RANGE env variable on git push. That is situation when commit exist on remote git but is not accessible with git clone. That is known issues and force push very rare case. Check only the latest commit in case of force push. On merge request and fast forward pushes validate all patches. .travis.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) -- 2.11.0.295.gd7dffce Reviewed-by: Mike Holmes diff --git a/.travis.yml b/.travis.yml index 5b9a29a6..9544ec8f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -95,6 +95,21 @@ before_install: - popd script: + - echo $TRAVIS_COMMIT_RANGE + - ODP_PACHES=`echo $TRAVIS_COMMIT_RANGE | sed 's/\.//'` +# Generate patches provided with $TRAVIS_COMMIT_RANGE. +# In case of force push and range is broken validate only the latest commit if it's not merge commit. + - git format-patch $ODP_PACHES; + if [ $? -ne 0 ]; then + git show --summary HEAD| grep -q '^Merge:'; + if [ $? -ne 0 ]; then + git format-patch HEAD^; + perl ./scripts/checkpatch.pl *.patch; + fi; + else + perl ./scripts/checkpatch.pl *.patch; + fi + - ./bootstrap - ./configure - make doxygen-doc