Right now I have a .clang-tidy
file that includes a large list of checks and they all go in one line like this:
Checks: '-*,bugprone-*,-bugprone-narrowing-conversions, cert-*, -cert-err58-cpp, clang-analyzer-*,cppcoreguidelines-*,-cppcoreguidelines-narrowing-conversions...'
Is there a way to list each check (enabled or disabled) in multiple lines for easier version control?
Right now I toggle word wrap and that helps editing, but it's very hard to diff in code reviews.
I'm looking for something like this:
Checks:
'-*,'
'cert-*,etc-*,'
...
Clang-tidy is a standalone linter tool for checking C and C++ source code files.
Run clang-tidy on you entire codebaseIn the build folder, run run-clang-tidy . It might be a different command ( run-clang-tidy.py or run-clang-tidy-VERSIONNUMBER ) depending on your distro's packaging preference.
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 -button or Alt+Enter : Gif.
You can remove the single quotation marks and list all checks in a line-breaking comma separated list that starts with a >
entry, constructing a .clang-tidy
file as follows:
---
Checks: >
-*,
cert-*,
etc-*,
<additional checks ...>
...
As of D30567: [clang-tidy] Fix treating non-space whitespaces in checks list the leading whitespace on each new line are only for readability, and you may choose any consistent number of leading spaces (YAML).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With