From 7af0c8559b6d9426dd5e977370516d2baa4c206f Mon Sep 17 00:00:00 2001 From: Nathan James Date: Sat, 16 May 2020 01:14:55 +0100 Subject: [PATCH] [clang-tidy] Transformer checks now store IncludeStyle option --- .../clang-tidy/utils/TransformerClangTidyCheck.cpp | 6 ++++++ .../clang-tidy/utils/TransformerClangTidyCheck.h | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.cpp b/clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.cpp index 3f7edd659c63..a15c429b696f 100644 --- a/clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.cpp +++ b/clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.cpp @@ -112,6 +112,12 @@ void TransformerClangTidyCheck::check( } } +void TransformerClangTidyCheck::storeOptions( + ClangTidyOptions::OptionMap &Opts) { + Options.store(Opts, "IncludeStyle", IncludeStyle, + IncludeSorter::getMapping()); +} + } // namespace utils } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.h b/clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.h index 796222373eb5..d99f927a7973 100644 --- a/clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.h +++ b/clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.h @@ -67,6 +67,10 @@ public: void registerMatchers(ast_matchers::MatchFinder *Finder) final; void check(const ast_matchers::MatchFinder::MatchResult &Result) final; + /// Derived classes that override this function should call this method from + /// the overridden method. + void storeOptions(ClangTidyOptions::OptionMap &Opts) override; + private: Optional Rule; const IncludeSorter::IncludeStyle IncludeStyle;