diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-05-25 12:16:28 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-05-25 12:16:28 +0300 |
commit | 934ec27a783a7ad02a078160c1010a6d443b3437 (patch) | |
tree | 143b6e92333945c28a5eebceb1d244e562da6682 | |
parent | a30e6e97b64d714aabeef90bafc413898ede2412 (diff) | |
download | mplint-934ec27a783a7ad02a078160c1010a6d443b3437.tar.gz mplint-934ec27a783a7ad02a078160c1010a6d443b3437.tar.bz2 mplint-934ec27a783a7ad02a078160c1010a6d443b3437.tar.xz mplint-934ec27a783a7ad02a078160c1010a6d443b3437.zip |
Count line numbers from 1.
-rw-r--r-- | src/lintmanager.cpp | 2 | ||||
-rw-r--r-- | src/rulebase.cpp | 4 | ||||
-rw-r--r-- | src/rules/license.cpp | 6 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/lintmanager.cpp b/src/lintmanager.cpp index 97ee925..bba2926 100644 --- a/src/lintmanager.cpp +++ b/src/lintmanager.cpp @@ -114,7 +114,7 @@ void LintManager::applyRulesToFile() FOR_EACH (std::vector<RuleBase*>::iterator, it, mSelectedRules) { RuleBase *const rule = *it; - int line = 0; + int line = 1; FOR_EACH (std::vector<std::string>::const_iterator, itStr, mFileData) { const std::string &str = *itStr; diff --git a/src/rulebase.cpp b/src/rulebase.cpp index 9cbf8bb..8b34ffe 100644 --- a/src/rulebase.cpp +++ b/src/rulebase.cpp @@ -27,7 +27,7 @@ RuleBase::RuleBase() : file(), ruleName(), - line(-1), + line(0), flag(true) { lint.addRule(this); @@ -65,5 +65,5 @@ void RuleBase::terminateRule() void RuleBase::init() { flag = true; - line = 0; + line = 1; } diff --git a/src/rules/license.cpp b/src/rules/license.cpp index fe81816..0ec320e 100644 --- a/src/rules/license.cpp +++ b/src/rules/license.cpp @@ -46,19 +46,19 @@ endRule(license) parseLineRule(license) { - if (line == 0 && data != "/*") + if (line == 1 && data != "/*") { print("Should be license header"); terminateRule(); return; } - else if (line == 1 && data != " * The ManaPlus Client") + else if (line == 2 && data != " * The ManaPlus Client") { print("Should be 'The ManaPlus Client' in header"); terminateRule(); return; } - else if (line > 1) + else if (line > 2) { if (checkText) { |