From patchwork Thu Nov 18 12:49:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 14624 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 9B58BBF415 for ; Thu, 18 Nov 2021 12:49:38 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9ED7860371; Thu, 18 Nov 2021 13:49:37 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="NVcXkvWa"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3921160231 for ; Thu, 18 Nov 2021 13:49:36 +0100 (CET) Received: from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id AE2A7E7 for ; Thu, 18 Nov 2021 13:49:35 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1637239775; bh=4+fxqBPPCooe0YyyEsoNBkUeS9P+pPx7gIM0IrKf9D4=; h=From:To:Subject:Date:From; b=NVcXkvWa0OYUHkS7KJL37OzmbxFtzHQsWHXf852P0o9T7lFqen7P1QFEYIwz2mLoK mREH7villXuaFsGuzihpsoYv9BBeypUWh7BebI5r9Mvjz9YeO+EZyf4mvn1s1AdFL0 6vwbHnTBode9PzyyNrB77rqNZ4shyhTc/F03bNb4= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Thu, 18 Nov 2021 14:49:10 +0200 Message-Id: <20211118124910.31123-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] Documentation: coding-style: Document the git commit hooks X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" checkstyle.py is ignored too often. Document how to automate its usage through git commit hooks. Signed-off-by: Laurent Pinchart Reviewed-by: Umang Jain Reviewed-by: Kieran Bingham --- Documentation/coding-style.rst | 8 ++++++++ 1 file changed, 8 insertions(+) base-commit: d9a2a1f703273a28b001dee40fddd378bba7a1b6 diff --git a/Documentation/coding-style.rst b/Documentation/coding-style.rst index 4e8d6988fef8..053fdd998351 100644 --- a/Documentation/coding-style.rst +++ b/Documentation/coding-style.rst @@ -418,4 +418,12 @@ diff that fixes the issues, on top of the corresponding commit. As the script is in early development false positive are expected. The flagged issues should be reviewed, but the diff doesn't need to be applied blindly. +Execution of checkstyle.py can be automated through git commit hooks. Example +of pre-commit and post-commit hooks are available in `utils/hooks/pre-commit` +and `utils/hooks/post-commit`. You can install either hook by copying it to +`.git/hooks/`. The post-commit hook is easier to start with as it will only flag +potential issues after committing, while the pre-commit hook will abort the +commit if issues are detected and requires usage of `git commit --no-verify` to +ignore false positives. + Happy hacking, libcamera awaits your patches!