renamed --check-includes to --check-config
This commit is contained in:
parent
aa85866bc0
commit
d998477c69
|
@ -575,9 +575,9 @@ bool CmdLineParser::ParseFromArgs(int argc, const char* const argv[])
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Check configuration
|
// Check configuration
|
||||||
else if (strcmp(argv[i], "--check-includes") == 0)
|
else if (strcmp(argv[i], "--check-config") == 0)
|
||||||
{
|
{
|
||||||
_settings->checkIncludes = true;
|
_settings->checkConfiguration = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Print help
|
// Print help
|
||||||
|
@ -648,9 +648,8 @@ void CmdLineParser::PrintHelp()
|
||||||
"Options:\n"
|
"Options:\n"
|
||||||
" --append=<file> This allows you to provide information about\n"
|
" --append=<file> This allows you to provide information about\n"
|
||||||
" functions by providing an implementation for these.\n"
|
" functions by providing an implementation for these.\n"
|
||||||
" --check-includes Check for missing includes. This option is used to\n"
|
" --check-config Check cppcheck configuration. The normal code\n"
|
||||||
" determine if the cppcheck configuration is ok. No\n"
|
" analysis is disabled by this flag.\n"
|
||||||
" code analysis is done during this check.\n"
|
|
||||||
" -D<ID> By default Cppcheck checks all configurations.\n"
|
" -D<ID> By default Cppcheck checks all configurations.\n"
|
||||||
" Use -D to limit the checking. When -D is used the\n"
|
" Use -D to limit the checking. When -D is used the\n"
|
||||||
" checking is limited to the given configuration.\n"
|
" checking is limited to the given configuration.\n"
|
||||||
|
@ -666,7 +665,7 @@ void CmdLineParser::PrintHelp()
|
||||||
" Check for unused functions\n"
|
" Check for unused functions\n"
|
||||||
" * missingInclude\n"
|
" * missingInclude\n"
|
||||||
" Warn if there are missing includes.\n"
|
" Warn if there are missing includes.\n"
|
||||||
" See also: --check-includes\n"
|
" For detailed information use --check-config\n"
|
||||||
" Several ids can be given if you separate them with\n"
|
" Several ids can be given if you separate them with\n"
|
||||||
" commas.\n"
|
" commas.\n"
|
||||||
" --error-exitcode=<n> If errors are found, integer [n] is returned instead\n"
|
" --error-exitcode=<n> If errors are found, integer [n] is returned instead\n"
|
||||||
|
|
|
@ -185,7 +185,7 @@ int CppCheckExecutor::check(int argc, const char* const argv[])
|
||||||
returnValue = executor.check();
|
returnValue = executor.check();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!cppCheck.settings().checkConfiguration())
|
if (!cppCheck.settings().checkConfiguration)
|
||||||
{
|
{
|
||||||
reportUnmatchedSuppressions(cppCheck.settings().nomsg.getUnmatchedGlobalSuppressions());
|
reportUnmatchedSuppressions(cppCheck.settings().nomsg.getUnmatchedGlobalSuppressions());
|
||||||
|
|
||||||
|
|
|
@ -122,7 +122,7 @@ unsigned int CppCheck::processFile()
|
||||||
preprocessor.preprocess(fin, filedata, configurations, _filename, _settings._includePaths);
|
preprocessor.preprocess(fin, filedata, configurations, _filename, _settings._includePaths);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_settings.checkConfiguration())
|
if (_settings.checkConfiguration)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -217,7 +217,7 @@ void CppCheck::analyseFile(std::istream &fin, const std::string &filename)
|
||||||
preprocessor.preprocess(fin, filedata, configurations, filename, _settings._includePaths);
|
preprocessor.preprocess(fin, filedata, configurations, filename, _settings._includePaths);
|
||||||
const std::string code = Preprocessor::getcode(filedata, "", filename, &_settings, &_errorLogger);
|
const std::string code = Preprocessor::getcode(filedata, "", filename, &_settings, &_errorLogger);
|
||||||
|
|
||||||
if (_settings.checkConfiguration())
|
if (_settings.checkConfiguration)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -250,7 +250,7 @@ void CppCheck::analyseFile(std::istream &fin, const std::string &filename)
|
||||||
|
|
||||||
void CppCheck::checkFile(const std::string &code, const char FileName[])
|
void CppCheck::checkFile(const std::string &code, const char FileName[])
|
||||||
{
|
{
|
||||||
if (_settings.terminated() || _settings.checkConfiguration())
|
if (_settings.terminated() || _settings.checkConfiguration)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Tokenizer _tokenizer(&_settings, this);
|
Tokenizer _tokenizer(&_settings, this);
|
||||||
|
|
|
@ -1936,7 +1936,7 @@ void Preprocessor::handleIncludes(std::string &code, const std::string &filePath
|
||||||
|
|
||||||
if (_errorLogger &&
|
if (_errorLogger &&
|
||||||
_settings &&
|
_settings &&
|
||||||
_settings->checkIncludes &&
|
_settings->checkConfiguration &&
|
||||||
(headerType == UserHeader || _settings->debugwarnings))
|
(headerType == UserHeader || _settings->debugwarnings))
|
||||||
{
|
{
|
||||||
std::string f = filePath;
|
std::string f = filePath;
|
||||||
|
|
|
@ -47,7 +47,7 @@ Settings::Settings()
|
||||||
test_2_pass = false;
|
test_2_pass = false;
|
||||||
reportProgress = false;
|
reportProgress = false;
|
||||||
ifcfg = false;
|
ifcfg = false;
|
||||||
checkIncludes = false;
|
checkConfiguration = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Settings::Suppressions::parseFile(std::istream &istr)
|
std::string Settings::Suppressions::parseFile(std::istream &istr)
|
||||||
|
|
|
@ -302,13 +302,7 @@ public:
|
||||||
std::list<Rule> rules;
|
std::list<Rule> rules;
|
||||||
|
|
||||||
/** Is the 'configuration checking' wanted? */
|
/** Is the 'configuration checking' wanted? */
|
||||||
bool checkConfiguration() const
|
bool checkConfiguration;
|
||||||
{
|
|
||||||
return checkIncludes;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Check configuration: includes */
|
|
||||||
bool checkIncludes;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
Loading…
Reference in New Issue