Skip to content

Commit 9ee0621

Browse files
committed
[clang-tidy][NFC] Add mention of running 'clang-tidy' on changes before submitting a patch
1 parent bce3cbc commit 9ee0621

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,25 @@ 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+
660679
Out-of-tree check plugins
661680
-------------------------
662681

0 commit comments

Comments
 (0)