[PATCH] D152589: [clang-tidy] Add readability test for not allowing relative includes

Piotr Zegar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jun 10 00:28:40 PDT 2023


PiotrZSL added a comment.

One more comment, according to this whitepaper you should actually check if include is relative, simply if `current file directory + include` exists and it's actually a file that is included, then its relative include.
Currently you checking only `""` and its not a thing that should be done, because include like this `#include "hello/utility.hpp" is also valid.
Therefor you should be checking included path, not an include style, and this is main problem of this check.
In such case proper name for it would be misc-no-relative-includes, and entire implementation of the check should be updated.
Also note that some projects put header files in same folder as source file, and uses "" include for them, this is one of the ways to deal with private/public includes.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D152589/new/

https://reviews.llvm.org/D152589



More information about the cfe-commits mailing list