llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.25k stars 11.66k forks source link

clang-tidy option to only run checks that offer fixes #54939

Open sweemer opened 2 years ago

sweemer commented 2 years ago

Can we add an option to clang-tidy to only runs checks that offer fixes?

The new option can be named something like --checks-with-fixes on the command line and ChecksWithFixes: true in the config file.

If the --checks or Checks: option is also specified then clang-tidy will only run the subset of specified checks that offer fixes.

For example, if the user specifies --checks-with-fixes --checks=-*,cppcoreguidelines-*,-cppcoreguidelines-init-variables, then clang-tidy will run all of the cppcoreguidelines checks that offer fixes except for cppcoreguidelines-init-variables.

Apologies if this is a duplicate - I searched and couldn't find any similar issues raised in the past.

llvmbot commented 2 years ago

@llvm/issue-subscribers-clang-tidy

bibrakc commented 1 year ago

@sweemer Did you find a way around this?

sweemer commented 1 year ago

Unfortunately not - I just run all the checks with the -fix flag even if the check doesn't offer a fix.