[PATCH] D92175: [clang-tidy] Add support for loading configs for specific files.

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 26 06:09:35 PST 2020


njames93 created this revision.
njames93 added reviewers: aaron.ballman, alexfh, gribozavr2.
Herald added subscribers: cfe-commits, usaxena95, kadircet, arphaman, xazax.hun.
Herald added a project: clang.
njames93 requested review of this revision.

There was already a basic version of this in IdentifierNamingCheck, controlled by an option GetConfigPerFile. This has now been changed to a global option UsePerFileConfig. As there hasn't been a release with GetConfigPerFile, This change shouldn't break anyones config.

Now there is support for this built into the base class directly, along with some basic caching.
As the clang-tidy providers used only have at best directory resolution, this caches based on directory rather than filename. This can potentially save alot of redundant config lookups.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D92175

Files:
  clang-tools-extra/clang-tidy/ClangTidyCheck.cpp
  clang-tools-extra/clang-tidy/ClangTidyCheck.h
  clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
  clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.h
  clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp
  clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.h
  clang-tools-extra/clangd/TidyProvider.cpp
  clang-tools-extra/docs/ReleaseNotes.rst
  clang-tools-extra/docs/clang-tidy/checks/readability-identifier-naming.rst
  clang-tools-extra/test/clang-tidy/checkers/readability-identifier-naming-multiple-styles.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92175.307850.patch
Type: text/x-patch
Size: 12226 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201126/0a7eb1a3/attachment-0001.bin>


More information about the cfe-commits mailing list