Having more than one check for header guards can potentially lead
to a conflict where different header guard checks suggest different
corrections. Refactor into a single HeaderGuardCheck that can
create one of multiple HeaderGuardStyle instances from a registry.
Refactor LLVMHeaderGuardCheck to extend this class.
Details
- Reviewers
sscalpone njames93 aaron.ballman hokein gribozavr2 carlosgalvezp - Group Reviewers
Restricted Project
Diff Detail
Event Timeline
Note: I do not have possibility to add code comments - is there some too strict permissions set for this patch? It has not happened to other patches.
Review comment:
I think the design choice in clang-tidy is that checks from different modules should not depend on each other like this, that's why a common utils folder exists.
What is the difference between llvm-header-guard and readability-header-guard? Could one be the alias of the other, possibly with some added configuration options?
Also, in general the design choice is that checks should be independent and authors should not need to care about whether they conflict with other checks. In this particular case, if both checks are providing different results, users should choose one and disable the other. Header guard style is a purely stylistic matter, so it's no surprise different checks will lead to different results.
I accidentally set the permissions too strict, I've fixed it here and on all my other diffs.
I think the design choice in clang-tidy is that checks from different modules should not depend on each other like this, that's why a common utils folder exists.
What is the difference between llvm-header-guard and readability-header-guard? Could one be the alias of the other, possibly with some added configuration options?
See the discussion in D142123. We decided it would be best to have a single readability-header-guard which can select one of several different styles. llvm-header-guard temporarily exists as a deprecated alias to readability-header-guard with the llvm style selected, and will be removed in a future version.