Skip to content

Commit 4e6157f

Browse files
authored
[clang-tidy][NFC] Add mention of running 'clang-tidy' on changes in Contributing.rst (#148547)
Follow up to #147793. _Originally suggested by carlosgalvezp in #147793 (comment)
1 parent 3eb0799 commit 4e6157f

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

clang-tools-extra/docs/clang-tidy/Contributing.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,29 @@ directory. The path to this directory is available in a lit test with the varia
657657
.. _FileCheck: https://llvm.org/docs/CommandGuide/FileCheck.html
658658
.. _test/clang-tidy/checkers/google/readability-casting.cpp: https://github.com/llvm/llvm-project/blob/main/clang-tools-extra/test/clang-tidy/checkers/google/readability-casting.cpp
659659

660+
661+
Submitting a Pull Request
662+
-------------------------
663+
664+
Before submitting a pull request, contributors are encouraged to run
665+
:program:`clang-tidy` and :program:`clang-format` on their changes to ensure
666+
code quality and catch potential issues. While :program:`clang-tidy` is not
667+
currently enforced in CI, following this practice helps maintain code
668+
consistency and prevent common errors.
669+
670+
Here's useful command to check your staged changes:
671+
672+
.. code-block:: console
673+
674+
$ git diff --staged -U0 | ./clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py \
675+
-j $(nproc) -path build/ -p1 -only-check-in-db
676+
$ git clang-format
677+
678+
Note that some warnings may be false positives or require careful consideration
679+
before fixing. Use your judgment and feel free to discuss in the pull request
680+
if you're unsure about a particular warning.
681+
682+
660683
Out-of-tree check plugins
661684
-------------------------
662685

0 commit comments

Comments
 (0)