Proper clang tidy fix support
Could we please get proper "fix" support that can be run fully threaded.
The problem is that CMake has clang-tidy support, but it doesn’t have direct support for delayed refactoring, so the CMake integration is currently more suitable to linting instead of refactoring tasks. See https://devblogs.microsoft.com/cppblog/exploring-clang-tooling-using-build-tools-with-clang-tidy for full details and the current workarounds that have to be employed to do a proper fast refactor.
Basically the trick to implement this is to
- make sure that clang-tidy is in invoked with --export-fixes=current-source-filename.yaml
- Use clang-apply-replacements to apply the yaml fixes
The first step can run in X processes as it exports to its own yaml file. The second step can run in x processes as it reads its own yaml file and exports to its own target file.
An minimal alternative implementation would be to allow us to specify a "--export-fixes=current-source-filename.yaml" per source file or something similar so it would be possible to do the rest of the tooling ourselves.
The current support for clang-tidy is basically useless for refactoring out of the box until its possible to specify a custom yaml file per source file. If I missed something and this is currently possible, please try to document it better since I have not been able to find any examples of this).