From 6e195426e72282a63f19d0fc448fb1d6730ccd07 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Mon, 15 Sep 2014 12:48:25 +0000 Subject: [clang-tidy] Add a checker for long functions. As this is very dependent on the code base it has some ways of configuration. It's possible to pick between 3 modes of operation: - Line counting: number of lines including whitespace and comments - Statement counting: number of statements within compoundStmts. - Branch counter In addition a threshold can be picked, warnings are only emitted when it is met. The thresholds can be configured via a .clang-tidy file. Differential Revision: http://reviews.llvm.org/D4986 llvm-svn: 217768 --- clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp') diff --git a/clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp b/clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp index 489f5b31dd7..6cfc967fbed 100644 --- a/clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp @@ -12,6 +12,7 @@ #include "../ClangTidyModuleRegistry.h" #include "ArgumentCommentCheck.h" #include "BoolPointerImplicitConversion.h" +#include "FunctionSize.h" #include "RedundantSmartptrGet.h" #include "SwappedArgumentsCheck.h" #include "UndelegatedConstructor.h" @@ -27,6 +28,7 @@ public: CheckFactories.registerCheck("misc-argument-comment"); CheckFactories.registerCheck( "misc-bool-pointer-implicit-conversion"); + CheckFactories.registerCheck("misc-function-size"); CheckFactories.registerCheck( "misc-redundant-smartptr-get"); CheckFactories.registerCheck( -- cgit v1.2.3