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:
parent
34aebad4b1
commit
270deade0e
1 changed files with 5 additions and 4 deletions
|
@ -272,15 +272,16 @@ following exceptions:
|
||||||
comment, ``//``, is not allowed.
|
comment, ``//``, is not allowed.
|
||||||
* Use ``/** */`` for doxygen comments that need to appear in the documentation.
|
* Use ``/** */`` for doxygen comments that need to appear in the documentation.
|
||||||
|
|
||||||
The Linux kernel GPL-licensed tool ``checkpatch`` is used to check coding
|
The Linux kernel GPL-licensed tool ``checkpatch`` is used to check
|
||||||
style conformity. Checkpatch is available in the scripts directory. To invoke
|
coding style conformity. Checkpatch is available in the scripts
|
||||||
it when committing code, edit your *.git/hooks/pre-commit* file to contain:
|
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
|
.. code-block:: bash
|
||||||
|
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e exec
|
set -e exec
|
||||||
exec git diff --cached | ${ZEPHYR_BASE}/scripts/checkpatch.pl - || true
|
exec git diff --cached | ${ZEPHYR_BASE}/scripts/checkpatch.pl -
|
||||||
|
|
||||||
.. _Contribution workflow:
|
.. _Contribution workflow:
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue