# Clang-Tidy integration

> **TL;DR**
> `Settings | Editor | Inspections | C/C++ | Static Analysis Tools | Clang-Tidy`
>
>
>
> Default configuration: [list of the enabled/disabled checks](https://youtrack.jetbrains.com/articles/CPP-A-90276519/Clang-Tidy-in-CLion:-default-configuration)
>
>
>
> Default severity: Warning

[Clang-Tidy](https://clang.llvm.org/extra/clang-tidy/) is a Clang-based tool for static code analysis. CLion shows Clang-Tidy checks the same way as its own code inspections, with quick-fixes available via the ![the Yellow bulb icon](https://resources.jetbrains.com/help/img/idea/2026.2/app.expui.codeInsight.intentionBulb.png)-button or `Alt+Enter` (Windows), `⌥ ⏎` (macOS), `⌥ ⏎` (IntelliJ IDEA Classic (macOS)), `⌥ ⏎` (macOS System Shortcuts), `Alt+Enter` (XWin), `Alt+Enter` (GNOME), `Alt+Enter` (KDE), `Alt+Enter` (Emacs), `Alt+Enter` (Sublime Text), `⌥ ⏎` (Sublime Text (macOS)), `⌥ ⏎` (Xcode), `Alt+Enter` (Visual Studio), `⌥ ⏎` (Visual Studio (macOS)), `Alt+Enter` (ReSharper), `⌥ ⏎` (ReSharper (macOS)), `Alt+Enter` (QtCreator), `⌥ ⏎` (QtCreator (macOS)), `Alt+Enter` (NetBeans), `Ctrl+1` (Eclipse), `⌘ 1` (Eclipse (macOS)):

![Clang-Tidy working on-the-fly](https://resources.jetbrains.com/help/img/idea/2026.2/cl_CTbasics.animated.gif)

## General Clang-Tidy settings

Clang-Tidy checks are enabled by default, and you can see them as warnings (or messages of another severity level) in the editor.

Note that not all the checks are enabled by default. [Here](https://youtrack.jetbrains.com/articles/CPP-A-90276519/Clang-Tidy-in-CLion:-default-configuration) you can find details of the Clang-Tidy default configuration in CLion.

To adjust the Clang-Tidy configuration, go to `Settings | Editor | Inspections | C/C++ | Static Analysis Tools | Clang-Tidy`:

![Settings for Clang-Tidy checks](https://resources.jetbrains.com/help/img/idea/2026.2/cl_clangtidy_settings.png)

Procedure: Configure the list of checks

* Click ![](https://resources.jetbrains.com/help/img/idea/2026.2/app.expui.general.edit.svg) to open the dialog where you can edit the list of checks:

![Clang-tidy checks tree view](https://resources.jetbrains.com/help/img/idea/2026.2/cl_clangtidy_checkslist.png)

To quickly find a particular check, start typing its name when the dialog is in focus.

On the left, you see the detailed description of each check from the [official Clang-Tidy
documentation website](https://clang.llvm.org/extra/clang-tidy/checks/list.html). You can also see a short overview from the editor. Hover over the highlighted code, in the tooltip that appears, click ![the More button](https://resources.jetbrains.com/help/img/idea/2026.2/app.actions.more.svg) and select Show Inspection Description:

![Clang-Tidy tooltip](https://resources.jetbrains.com/help/img/idea/2026.2/cl_clang_tidy_tooltip.png)

* You can also enable/disable particular checks manually using the [Clang-Tidy command line format](https://clang.llvm.org/extra/clang-tidy/#using-clang-tidy).

Specify a comma-separated list of positive and negative globs: positive globs add subsets of checks, while negative globs (prefixed with `"-"`) remove them.

For example, the following command line will disable all default checks `-*` and enable all the `clang-analyzer-*` checks except for the `clang-analyzer-cplusplus*` ones:

```
-*,clang-analyzer-*,-clang-analyzer-cplusplus*
```

> **Tip:**
> You can set the desired [severity level](configuring-inspection-severities.html#change-severity) and [scope](configuring-inspection-severities.html#severity-in-scope) for Clang-Tidy checks by selecting from the drop-down lists.

Procedure: Configure options for particular checks

Some Clang-Tidy checks have options, which are either additional or substantial for the check (like those for [readability-identifier-naming](http://clang.llvm.org/extra/clang-tidy/checks/readability-identifier-naming.html)).

* Click Configure Clang-Tidy Checks Options to open the options dialog.

* The options are displayed with predefined default values. If you change an option, you will see it highlighted in blue.

To quickly search in the list, put the dialog in focus and start typing.

![Options for checks](https://resources.jetbrains.com/help/img/idea/2026.2/cl_clangtidy_optionchecks.png)

## Tuning checks in the editor

In addition to the Inspections Settings dialog, you can disable a single check, a group of checks, or the entire Clang-Tidy inspection from the editor. These actions respectively update the Clang-Tidy command line.

![Configuring checks from the context menu](https://resources.jetbrains.com/help/img/idea/2026.2/cl_clangtidy_editor.png)

To [suppress](disabling-and-enabling-inspections.html#suppress-inspections) a Clang-Tidy check for a particular line, use the Suppress "check_name" for line option. CLion will add a `// NOLINT` comment at the end of the selected line.

> **Tip:**
> The editor's menu for Clang-Tidy inspection is not available when .clang-tidy [configuration files](#conffiles) are used instead of CLion settings.

## Configuration files

With `.clang-tidy` files, you can set per-directory configurations: for each source file, Clang-Tidy will attempt to read configuration from `.clang-tidy` in the closest parent directory.

To open the `.clang-tidy` configuration file used by the current source file, select Edit clang-tidy file for <current file> in the widget on the status bar:

![Edit .clang-tidy file](https://resources.jetbrains.com/help/img/idea/2026.2/cl_edit_clang_tidy.png)

If there's no `.clang-tidy` configuration available for the currently opened source file, you can create one by selecting Create .clang-tidy file in the widget:

![Create a .clang-tidy file](https://resources.jetbrains.com/help/img/idea/2026.2/cl_create_clang_tidy.png)

The new file will include settings configured in `Settings | Editor | Inspections | C/C++ - Static Analysis Tools - Clang-Tidy`.

> **Note:**
> The widget is available only if the Prefer .clang-tidy files over IDE settings checkbox is selected in `Settings | Editor | Inspections | C/C++ - Static Analysis Tools - Clang-Tidy`.

`.clang-tidy` files are in the [YAML](http://yaml.org/) format. For a syntax example, let's enable all the Clang-Tidy checks and provide the additional option to `modernize-use-nullptr`:

```CONSOLE
Checks: '*'
CheckOptions:
    - key:             modernize-use-nullptr.NullMacros
      value:           NULL,CUSTOM_NULL
```

By default, [.clang-tidy](http://www.labri.fr/perso/fleury/posts/programming/using-clang-tidy-and-clang-format.html) files take precedence over the IDE settings. When analyzing a source file, CLion uses the settings from a reachable configuration file (located in the current directory or in one of the parent directories). If there is no such file, CLion relies on its own settings.

To change this behavior, clear the Prefer .clang-tidy files over IDE settings checkbox in `Settings | Editor | Inspections` - `C/C++, Static Analysis Tools, Clang-Tidy`.

## Custom Clang-Tidy executable

You can work with your own Clang-Tidy executable instead of the bundled one (for example, when you want to create [custom checks](http://clang.llvm.org/extra/clang-tidy/#getting-involved) and use them in CLion).

Provide the path to your custom Clang-Tidy binary in `Settings | Languages & Frameworks | C/C++` (or click Specify Clang-Tidy executable in the Inspections Settings dialog).

![Custom Clang-Tidy binary](https://resources.jetbrains.com/help/img/idea/2026.2/cl_clangtidy_custombinary.png)

This setting is IDE-wide: your custom Clang-Tidy binary will be used for all projects.

## Notification on Clang-Tidy updates

CLion bundles Clang-Tidy from the corresponding LLVM revision, so when CLion releases a Clang update, the bundled Clang-Tidy executable gets updated to a newer version, and the IDE shows a notification:

![Notification on Clang-Tidy updates](https://resources.jetbrains.com/help/img/idea/2026.2/cl_clangtidy_update_notification.png)

Click Review to open a list of the available new checks and their activation state according to the Clang-Tidy [inspection settings](#generalsettings). You can enable or disable the checks in this dialog, and Clang-Tidy settings will change accordingly.

![List of new Clang-Tidy checks](https://resources.jetbrains.com/help/img/idea/2026.2/cl_clangtidy_update_diff.png)

If you use a [custom configuration file](#conffiles) instead of the IDE settings, this notification will also warn you that clang-tidy files may overwrite your IDE settings.

> **Note:**
> Currently, the notification is shown only once per new IDE version launch.

## See also

### External Links

[JetBrains CLion blog](https://blog.jetbrains.com/clion)

