aboutsummaryrefslogtreecommitdiffstats
path: root/src/ClazyStandaloneMain.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ClazyStandaloneMain.cpp')
-rw-r--r--src/ClazyStandaloneMain.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/ClazyStandaloneMain.cpp b/src/ClazyStandaloneMain.cpp
index a84217ae..697091e6 100644
--- a/src/ClazyStandaloneMain.cpp
+++ b/src/ClazyStandaloneMain.cpp
@@ -56,6 +56,19 @@ static cl::opt<bool> s_qtDeveloper("qt-developer", cl::desc("For running clazy o
static cl::opt<bool> s_visitImplicitCode("visit-implicit-code", cl::desc("For visiting implicit code like compiler generated constructors. None of the built-in checks benefit from this, but can be useful for custom checks"),
cl::init(false), cl::cat(s_clazyCategory));
+static cl::opt<bool> s_ignoreIncludedFiles("ignore-included-files", cl::desc("Only emit warnings for the current file being compiled and ignore any includes. Useful for performance reasons."),
+ cl::init(false), cl::cat(s_clazyCategory));
+
+static cl::opt<std::string> s_headerFilter("header-filter", cl::desc(R"(Regular expression matching the names of the
+headers to output diagnostics from. Diagnostics
+from the main file of each translation unit are
+always displayed.)"),
+ cl::init(""), cl::cat(s_clazyCategory));
+
+static cl::opt<std::string> s_ignoreDirs("ignore-dirs", cl::desc(R"(Regular expression matching the names of the
+directories for which diagnostics should never be emitted. Useful for ignoring 3rdparty code.)"),
+ cl::init(""), cl::cat(s_clazyCategory));
+
static cl::extrahelp s_commonHelp(CommonOptionsParser::HelpMessage);
class ClazyToolActionFactory : public clang::tooling::FrontendActionFactory
@@ -85,7 +98,10 @@ public:
if (s_visitImplicitCode.getValue())
options |= ClazyContext::ClazyOption_VisitImplicitCode;
- return new ClazyStandaloneASTAction(s_checks.getValue(), options);
+ if (s_ignoreIncludedFiles.getValue())
+ options |= ClazyContext::ClazyOption_IgnoreIncludedFiles;
+
+ return new ClazyStandaloneASTAction(s_checks.getValue(), s_headerFilter.getValue(), s_ignoreDirs.getValue(), options);
}
};