Skip to content

Commit 8653569

Browse files
cederomacassis
authored andcommitted
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>
1 parent a33c555 commit 8653569

2 files changed

Lines changed: 12 additions & 9 deletions

File tree

Documentation/components/tools/checkpatch.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _checkpatch.sh:
2+
13
=================
24
``checkpatch.sh``
35
=================

Documentation/contributing/coding_style.rst

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,29 @@ C Coding Standard
88
NuttX follows a specific coding style which needs to be followed at all times
99
a contribution to be accepted. Please read this document before working on
1010
new code so that you can follow the style from the start. To check your code
11-
for conformance to the coding style, you should use the checkpatch.sh script
12-
(that calls the `nxstyle <#nxstyle>`_ tool) included under ``tools/`` in the
13-
main NuttX repository, or enable the pre-commit functionality described in
14-
`pre-commit <#precommit>`__.
11+
for conformance to the coding style, you should use the :ref:`checkpatch.sh`
12+
script (that calls the `nxstyle <#nxstyle>`_ tool) included under ``tools/``
13+
in the main NuttX repository, or enable the pre-commit functionality
14+
described in `pre-commit <#precommit>`__.
1515

1616
**************************
1717
Quick Check for Compliance
1818
**************************
1919

20-
You should check for coding style issues before submitting your Pull Request.
21-
There is a script that you can run to check for coding styles issue:
20+
Please verify formatting of your git commits before a Pull Request is
21+
submitted/updated. Use :ref:`checkpatch.sh` script that will verify the coding
22+
style, encoding, and spelling issues:
2223

2324
.. code-block:: bash
2425
25-
./tools/checkpatch.sh -g HEAD~...HEAD
26+
./tools/checkpatch.sh -c -u -m -g HEAD~...HEAD
2627
2728
Alternatevily you can run this script passing the .c file or .h header you
28-
want to check:
29+
want to check using ``-f`` switch:
2930

3031
.. code-block:: bash
3132
32-
./tools/checkpatch.sh -f path/to/your/file.c
33+
./tools/checkpatch.sh -c -u -m -f path/to/your/file.c
3334
3435
*******************
3536
General Conventions

0 commit comments

Comments
 (0)