Skip to content

Update clang-tidy.md #5033

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

Merged
merged 4 commits into from
May 22, 2024
Merged
Changes from 1 commit
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
6 changes: 5 additions & 1 deletion docs/code-quality/clang-tidy.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Using Clang-Tidy in Visual Studio
description: "How to use Clang-Tidy in Visual Studio for Microsoft C++ code analysis."
ms.date: 03/1/2022
ms.topic: "conceptual"
f1_keywords: ["vs.codeanalysis.clangtidy"]
f1_keywords: ["vs.codeanalysis.clangtidy","vs.codeanalysis.propertypages.ClangTidyToolPath"]
---
# Using Clang-Tidy in Visual Studio

Expand Down Expand Up @@ -90,6 +90,10 @@ Clang-Tidy runs result in warnings displayed in the Error List, and as in-editor

By default, Clang-Tidy does not set any checks when enabled. To see the list of checks in the command-line version, run `clang-tidy -list-checks` in a developer command prompt. You can configure the checks that Clang-Tidy runs inside Visual Studio. In the project Property Pages dialog, open the **Configuration Properties** > **Code Analysis** > **Clang-Tidy** page. Enter checks to run in the **Clang-Tidy Checks** property. A good default set is `clang-analyzer-*`. This property value is provided to the **`--checks`** argument of the tool. Any further configuration can be included in custom *`.clang-tidy`* files. For more information, see the [Clang-Tidy documentation on LLVM.org](https://clang.llvm.org/extra/clang-tidy/).

## Clang-Tidy Tool Directory

If you'd like to have custom rules built into your clang-tidy executable and run it in VS, you can change the path to the executable that Visual Studio runs. In the project Property Pages dialog, open the **Configuration Properties** > **Code Analysis** > **Clang-Tidy** page. Manually type in the path or Browse and select the path under the **Clang-Tidy Tool Directory** property. Once the change is saved, the new executable will be used after the next succesful compilation.

## See also

[Clang/LLVM support for MSBuild projects](https://devblogs.microsoft.com/cppblog/clang-llvm-support-for-msbuild-projects/)\
Expand Down