From patchwork Tue Sep 24 09:44:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Finucane X-Patchwork-Id: 1166479 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46cxBD1yryz9sP7 for ; Tue, 24 Sep 2019 19:45:08 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=that.guru Authentication-Results: ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=that.guru header.i=@that.guru header.b="jekBh48b"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46cxBC4t6vzDqSc for ; Tue, 24 Sep 2019 19:45:07 +1000 (AEST) X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=none (mailfrom) smtp.mailfrom=that.guru (client-ip=160.202.107.74; helo=q2relay74.mxroute.com; envelope-from=stephen@that.guru; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=that.guru Authentication-Results: lists.ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=that.guru header.i=@that.guru header.b="jekBh48b"; dkim-atps=neutral Received: from q2relay74.mxroute.com (q2relay74.mxroute.com [160.202.107.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46cx9z5S6XzDqS8 for ; Tue, 24 Sep 2019 19:44:55 +1000 (AEST) Received: from filter001.mxrelay.co ([64.52.23.203] filter001.mxrelay.co) (Authenticated sender: mN4UYu2MZsgR) by q2relay74.mxroute.com (ZoneMTA) with ESMTPSA id 16d62a8cc4700095b2.001 for (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256); Tue, 24 Sep 2019 09:44:52 +0000 X-Zone-Loop: e4e47e828ee5622367060e19df419c6e12b9ec5665ec X-Originating-IP: [64.52.23.203] Received: from one.mxroute.com (one.mxroute.com [195.201.59.211]) by filter001.mxrelay.co (Postfix) with ESMTPS id 464E11008DA for ; Tue, 24 Sep 2019 09:44:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=that.guru; s=default; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=18f+E8Tzi61JOd59AgobYaIc5OgyJw5a6PkWQRXCr0A=; b=jekBh48b8jjND9w1RP++mewwfL PLiTenCRELSjbiGKoDCfmZxgwpijvEgFmuCWHNYjGWV5Q53gKq252d0ArWlliSoZGSRxqv1u1mRsb oHZyG3d0Tn0Zr3hJ3b75h1gNGPuFEIPiZjMiYmyo/ryg5Qi3rdSmS/0WEXoTISyKCAohiYmBRLR9K 6voBC8douJibxSe3ywc5tGMvl/RDU+xQqSY6T27t7UWOWZ9Aqyftc0Rn+Lb8utiQAz/bWQfBgmK8/ KSL4qNQzi8qAtEiYiRhEfLXG4PLCdMo8glkPZsyDY2bWJjDWGm1mo6vSS4gs5fehvLgmWCQ/wYyH/ MEGU18Xw==; From: Stephen Finucane To: patchwork@lists.ozlabs.org Subject: [PATCH 2/2] Integrate 'pre-commit' Date: Tue, 24 Sep 2019 10:44:45 +0100 Message-Id: <20190924094445.19820-2-stephen@that.guru> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190924094445.19820-1-stephen@that.guru> References: <20190924094445.19820-1-stephen@that.guru> MIME-Version: 1.0 X-AuthUser: stephen@that.guru X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" Helps me avoid simple style issues. We explicitly disable newline checks for some files where the "fix" would be harmful (e.g. mboxes and templates). Signed-off-by: Stephen Finucane --- .pre-commit-config.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..bea1187a --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,20 @@ +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v2.3.0 + hooks: + - id: check-executables-have-shebangs + - id: check-merge-conflict + - id: check-yaml + - id: end-of-file-fixer + exclude: (.*\.mbox)|(.*\.css)|(.*\.json)|(.*\.js)|(.*\.svg)|(.*/mails/.*-subject\.txt) + - id: flake8 + exclude: ^patchwork/migrations + - id: trailing-whitespace + exclude: (.*\.mbox)|(.*\.svg) +- repo: https://github.com/Lucas-C/pre-commit-hooks + rev: v1.1.7 + hooks: + - id: remove-tabs + exclude: (.*\.mbox)|(.*\.svg)|(.*\.sql)|(.*\.conf) + - id: remove-crlf + exclude: (.*\.mbox)|(.*\.svg)