[all-commits] [llvm/llvm-project] d6a468: [clang-tidy] adding "--config-file=<file-path>" to...

Dmitry Polukhin via All-commits all-commits at lists.llvm.org
Tue Nov 3 04:02:00 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: d6a468d622b2d48c40c47290aa54d6d910c5a6bf
      https://github.com/llvm/llvm-project/commit/d6a468d622b2d48c40c47290aa54d6d910c5a6bf
  Author: Hiral Oza <hiral.oza at netapp.com>
  Date:   2020-11-03 (Tue, 03 Nov 2020)

  Changed paths:
    M clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp
    A clang-tools-extra/test/clang-tidy/infrastructure/Inputs/config-file/config-file
    A clang-tools-extra/test/clang-tidy/infrastructure/config-file.cpp

  Log Message:
  -----------
  [clang-tidy] adding "--config-file=<file-path>" to specify custom config file.

Let clang-tidy to read config from specified file.
Example:
$ clang-tidy --config-file=/some/path/myTidyConfig --list-checks --
...this will read config from '/some/path/myTidyConfig'.

ClangTidyMain.cpp reads ConfigFile into string and then assigned read data to 'Config' i.e. makes like '--config' code flow internally.

May speed-up tidy runtime since now it will just look-up <file-path>
instead of searching ".clang-tidy" in parent-dir(s).

Directly specifying config path helps setting build dependencies.

Thanks to @DmitryPolukhin for valuable suggestion. This patch now propose
change only in ClangTidyMain.cpp.

Reviewed By: DmitryPolukhin

Differential Revision: https://reviews.llvm.org/D89936




More information about the All-commits mailing list