From 270deade0e3aa8a272184bc6699cdc1a050abea7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Wed, 3 Jan 2018 11:06:27 +0100 Subject: [PATCH] doc: checkpatch: Fix pre-commit hook MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The pre-commit hook was or'ing with true and therefore never triggering when there were checkpatch errors. Also; Documented that the file needs to be made executable. Made it more clear that the file is located in the zephyr git directory. Signed-off-by: Sebastian Bøe --- CONTRIBUTING.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 12429c55f51..6e91225a5ee 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -272,15 +272,16 @@ following exceptions: comment, ``//``, is not allowed. * Use ``/** */`` for doxygen comments that need to appear in the documentation. -The Linux kernel GPL-licensed tool ``checkpatch`` is used to check coding -style conformity. Checkpatch is available in the scripts directory. To invoke -it when committing code, edit your *.git/hooks/pre-commit* file to contain: +The Linux kernel GPL-licensed tool ``checkpatch`` is used to check +coding style conformity. Checkpatch is available in the scripts +directory. To invoke it when committing code, make the file +*$ZEPHYR_BASE/.git/hooks/pre-commit* executable and edit it to contain: .. code-block:: bash #!/bin/sh set -e exec - exec git diff --cached | ${ZEPHYR_BASE}/scripts/checkpatch.pl - || true + exec git diff --cached | ${ZEPHYR_BASE}/scripts/checkpatch.pl - .. _Contribution workflow: