[PATCH] D141000: [clang-tidy] Introduce HeaderFileExtensions option

Carlos Galvez via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 4 09:10:08 PST 2023


carlosgalvezp created this revision.
Herald added subscribers: arphaman, xazax.hun.
Herald added a reviewer: njames93.
Herald added a project: All.
carlosgalvezp requested review of this revision.
Herald added a project: clang-tools-extra.
Herald added a subscriber: cfe-commits.

We have a number of checks designed to analyze problems
in header files only, for example:

bugprone-suspicious-include
google-build-namespaces
llvm-header-guard
misc-definitions-in-header
...

All these checks duplicate the same logic and options
to determine whether a location is placed in the main
source file or in the header. More checks are coming
up with similar requirements.

Thus, to remove duplication, let's move this option
to the top-level configuration of clang-tidy (since
it's something all checks should share).

Fixing the duplication in existing checks will be
done in separate patches.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D141000

Files:
  clang-tools-extra/clang-tidy/ClangTidyOptions.cpp
  clang-tools-extra/clang-tidy/ClangTidyOptions.h
  clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp
  clang-tools-extra/docs/ReleaseNotes.rst
  clang-tools-extra/docs/clang-tidy/index.rst
  clang-tools-extra/unittests/clang-tidy/ClangTidyOptionsTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141000.486314.patch
Type: text/x-patch
Size: 30752 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230104/1bd5cf8d/attachment-0001.bin>


More information about the cfe-commits mailing list