Message ID | 20200117191733.198897-1-nicolas@ndufresne.ca |
---|---|
Headers | show
Return-Path: <nicolas@ndufresne.ca> Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D159860456 for <libcamera-devel@lists.libcamera.org>; Fri, 17 Jan 2020 20:17:51 +0100 (CET) Received: from nicolas-tpx395.localdomain (unknown [IPv6:2610:98:8005::127]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: nicolas) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 274952949D4; Fri, 17 Jan 2020 19:17:51 +0000 (GMT) From: Nicolas Dufresne <nicolas@ndufresne.ca> To: libcamera-devel@lists.libcamera.org Cc: Nicolas Dufresne <nicolas.dufresne@collabora.com> Date: Fri, 17 Jan 2020 14:17:27 -0500 Message-Id: <20200117191733.198897-1-nicolas@ndufresne.ca> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [libcamera-devel] [PATCH v2 0/6] Add the ability to do pre-commit style check X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: <libcamera-devel.lists.libcamera.org> List-Unsubscribe: <https://lists.libcamera.org/options/libcamera-devel>, <mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe> List-Archive: <https://lists.libcamera.org/pipermail/libcamera-devel/> List-Post: <mailto:libcamera-devel@lists.libcamera.org> List-Help: <mailto:libcamera-devel-request@lists.libcamera.org?subject=help> List-Subscribe: <https://lists.libcamera.org/listinfo/libcamera-devel>, <mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe> X-List-Received-Date: Fri, 17 Jan 2020 19:17:52 -0000 |
Series |
|
Related |
show
|
From: Nicolas Dufresne <nicolas.dufresne@collabora.com> This series adds the ability to do pre-commit style check. Internally, this adds the ability to use checkstyle.py to check index changes (--staged) and the combined changes the index changes and the last commit (--amend). Hopefully I have covered all the review comments, note that I ended up refactoring a lot with hope this is cleaner and less ambiguous. Changes in v2: - Fixed the checkstyle.py mode - Split into smaller patches - Only pass 0 or 1 to exit() - Replace boolean "staged" parameter with a Commit object - Subclass Commit to introduce special cases for Index and Amendment - Introduce a argument "--amend" to disambeguate the CLI Nicolas Dufresne (6): checkstyle: Move from pep8 to pycodestyle checkstyle: Exit with 1 status if issues are found checkstyle: Introduce a Commit class checkstyle: Add support for checking style on indexed changes checkstyle: Add support for checking style on amendments checkstyle: Add a pre-commit hook script utils/checkstyle.py | 114 +++++++++++++++++++++++++++++++++-------- utils/hooks/pre-commit | 17 ++++++ 2 files changed, 110 insertions(+), 21 deletions(-) create mode 100755 utils/hooks/pre-commit