Skip to content

Commit 120c393

Browse files
committed
comment why information message should be skipped when --max-configs is used
1 parent e5da14c commit 120c393

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/cppcheck.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,8 +1088,13 @@ unsigned int CppCheck::checkInternal(const FileWithDetails& file, const std::str
10881088
// Check only a few configurations (default 12), after that bail out, unless --force
10891089
// was used.
10901090
if (!mSettings.force && ++checkCount > mSettings.maxConfigs) {
1091-
// if maxConfigs has default value then report information message that configurations are skipped
1092-
if (mSettings.maxConfigs == 12 && mSettings.severity.isEnabled(Severity::information))
1091+
// If maxConfigs has default value then report information message that configurations are skipped.
1092+
// If maxConfigs does not have default value then the user is explicitly skipping configurations so
1093+
// the information message is not reported, the whole purpose of setting i.e. --max-configs=1 is to
1094+
// skip configurations. When --check-config is used then tooManyConfigs will be reported even if the
1095+
// value is non-default.
1096+
const Settings defaultSettings;
1097+
if (mSettings.maxConfigs == defaultSettings.maxConfigs && mSettings.severity.isEnabled(Severity::information))
10931098
tooManyConfigsError(Path::toNativeSeparators(file.spath()), configurations.size());
10941099

10951100
break;

0 commit comments

Comments
 (0)