command line: added 'information' id to enable

This commit is contained in:
Daniel Marjamäki 2011-01-05 21:20:21 +01:00
parent 21af64049c
commit 033e759c39
6 changed files with 7 additions and 5 deletions

View File

@ -512,6 +512,7 @@ void CmdLineParser::PrintHelp()
" --enable=id Enable additional checks. The available ids are:\n"
" * all - enable all checks\n"
" * style - Check coding style\n"
" * information - Enable information messages\n"
" * unusedFunction - check for unused functions\n"
" * missingInclude - check for missing includes\n"
" Several ids can be given if you separate them with commas\n"

View File

@ -891,7 +891,7 @@ void CheckClass::thisSubtractionError(const Token *tok)
void CheckClass::checkConst()
{
if (!_settings->_checkCodingStyle || _settings->ifcfg)
if (!_settings->isEnabled("information") || _settings->ifcfg)
return;
// Don't check C# and JAVA classes

View File

@ -1887,7 +1887,7 @@ void CheckOther::unassignedVariableError(const Token *tok, const std::string &va
void CheckOther::checkVariableScope()
{
if (!_settings->_checkCodingStyle)
if (!_settings->isEnabled("information"))
return;
SymbolDatabase *symbolDatabase = _tokenizer->getSymbolDatabase();

View File

@ -195,6 +195,7 @@ std::string Settings::addEnabled(const std::string &str)
std::set<std::string> id;
id.insert("missingInclude");
id.insert("unusedFunction");
id.insert("information");
if (str == "all")
{

View File

@ -2929,7 +2929,7 @@ private:
if (s)
settings = *s;
else
settings._checkCodingStyle = true;
settings.addEnabled("information");
// Tokenize..
Tokenizer tokenizer(&settings, this);
@ -5218,7 +5218,7 @@ private:
"};";
Settings settings;
settings._checkCodingStyle = true;
settings.addEnabled("information");
settings.ifcfg = false;
checkConst(code, &settings);

View File

@ -378,7 +378,7 @@ private:
errout.str("");
Settings settings;
settings._checkCodingStyle = true;
settings.addEnabled("information");
// Tokenize..
Tokenizer tokenizer(&settings, this);