From 1efc425551c0c7ac95cacad8f63dc31eb46c1f04 Mon Sep 17 00:00:00 2001 From: Alexander Kornienko Date: Thu, 16 Oct 2014 11:27:57 +0000 Subject: [clang-tidy] Default options in modules. Summary: This patch allows modules to specify default options for the checks defined in them. This way a sufficiently configurable check can be registered in multiple modules with different default options. E.g. the SpacesBeforeComments option may be set to 1 for the "llvm-namespace-comments" check and to 2 for the "google-readability-namespace-comment" check without modifying or extending the check code. This patch also registers the google-readability-braces-around-statements check with suitable defaults. Reviewers: djasper Reviewed By: djasper Subscribers: curdeius, cfe-commits Differential Revision: http://reviews.llvm.org/D5798 llvm-svn: 219923 --- clang-tools-extra/clang-tidy/ClangTidyModule.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'clang-tools-extra/clang-tidy/ClangTidyModule.h') diff --git a/clang-tools-extra/clang-tidy/ClangTidyModule.h b/clang-tools-extra/clang-tidy/ClangTidyModule.h index 6406d63651b..c1851b9ed58 100644 --- a/clang-tools-extra/clang-tidy/ClangTidyModule.h +++ b/clang-tools-extra/clang-tidy/ClangTidyModule.h @@ -87,6 +87,9 @@ public: /// \brief Implement this function in order to register all \c CheckFactories /// belonging to this module. virtual void addCheckFactories(ClangTidyCheckFactories &CheckFactories) = 0; + + /// \brief Gets default options for checks defined in this module. + virtual ClangTidyOptions getModuleOptions(); }; } // end namespace tidy -- cgit v1.2.3