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

Erez Amihud via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 9 15:19:11 PDT 2023


ErezAmihud created this revision.
ErezAmihud added reviewers: clang-tools-extra, njames93.
ErezAmihud created this object with edit policy "Administrators".
ErezAmihud added a project: clang-tools-extra.
Herald added subscribers: PiotrZSL, carlosgalvezp.
Herald added a project: All.
ErezAmihud requested review of this revision.
Herald added a subscriber: cfe-commits.

Hi, it would be nice to add a check that warn if it finds a relative include. This is to allow people to easily conform to the canonical project structure - https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1204r0.html

The check issue a warning for every relative include (e.g. any include that uses regular quotes).

Github issue:
https://github.com/llvm/llvm-project/issues/63226


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D152589

Files:
  clang-tools-extra/clang-tidy/readability/AbsoluteIncludesOnlyCheck.cpp
  clang-tools-extra/clang-tidy/readability/AbsoluteIncludesOnlyCheck.h
  clang-tools-extra/clang-tidy/readability/CMakeLists.txt
  clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp
  clang-tools-extra/docs/ReleaseNotes.rst
  clang-tools-extra/docs/clang-tidy/checks/list.rst
  clang-tools-extra/docs/clang-tidy/checks/readability/absolute-includes-only.rst
  clang-tools-extra/test/clang-tidy/checkers/readability/absolute-includes-only.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152589.530096.patch
Type: text/x-patch
Size: 9101 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230609/e5451663/attachment-0001.bin>


More information about the cfe-commits mailing list