Files
nuttx/Documentation/components/tools/checkpatch.rst
T
Tomasz 'CeDeROM' CEDRO 865356908d doc: Contributing tools/checkpatch.sh example update.
* Add `./tools/checkpatch.sh -c -u -m -g HEAD~...HEAD` example
  to match checks performed by our CI.
* Add cross-reference to checkpatch.sh documentation.

Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
2026-04-18 19:06:06 -03:00

32 lines
1.1 KiB
ReStructuredText

.. _checkpatch.sh:
=================
``checkpatch.sh``
=================
``checkpatch.sh`` is a bash script that makes use of ``nxstyle`` and
``codespell`` tools to format patches and ensure that files conform to NuttX
coding standard. It is used in NuttX's GitHub CI.
Help message:
.. code:: console
$ tools/checkpatch.sh -h
USAGE: tools/checkpatch.sh [options] [list|-]
Options:
-h
-c spell check with codespell (install with: pip install codespell)
-u encoding check with cvt2utf (install with: pip install cvt2utf)
-r range check only (coupled with -p or -g)
-p <patch file names> (default)
-m Check commit message (coupled with -g)
-g <commit list>
-f <file list>
-x format supported files (only .py, requires: pip install black)
- read standard input mainly used by git pre-commit hook as below:
git diff --cached | ./tools/checkpatch.sh -
Where a <commit list> is any syntax supported by git for specifying git revision, see GITREVISIONS(7)
Where a <patch file names> is a space separated list of patch file names or wildcard. or *.patch