doc: checkpatch: Fix pre-commit hook

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 <sebastian.boe@nordicsemi.no>
This commit is contained in:
Sebastian Bøe 2018-01-03 11:06:27 +01:00 committed by Anas Nashif
commit 270deade0e

View file

@ -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: