Skip to content

[clang-tidy][NFC] Add mention of running 'clang-tidy' on changes in Contributing.rst #148547

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions clang-tools-extra/docs/clang-tidy/Contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,29 @@ directory. The path to this directory is available in a lit test with the varia
.. _FileCheck: https://llvm.org/docs/CommandGuide/FileCheck.html
.. _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


Submitting a Pull Request
-------------------------

Before submitting a pull request, contributors are encouraged to run
:program:`clang-tidy` and :program:`clang-format` on their changes to ensure
code quality and catch potential issues. While :program:`clang-tidy` is not
currently enforced in CI, following this practice helps maintain code
consistency and prevent common errors.

Here's useful command to check your staged changes:

.. code-block:: console

$ git diff --staged -U0 | ./clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py \
-j $(nproc) -path build/ -p1 -only-check-in-db
$ git clang-format

Note that some warnings may be false positives or require careful consideration
before fixing. Use your judgment and feel free to discuss in the pull request
if you're unsure about a particular warning.


Out-of-tree check plugins
-------------------------

Expand Down
Loading