Skip to content

Commit

Permalink
rules name start with lowercase
Browse files Browse the repository at this point in the history
  • Loading branch information
donhui committed Sep 1, 2019
1 parent 6033d7c commit b9ced2d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -247,15 +247,15 @@ private void matchRuleAndSaveIssue(String sql, String sourceMapperFilePath, Inte
} else if (!sql.contains(WHERE)) {
if (sql.startsWith(DELETE)) {
// Where condition not found in delete statement
errorMessage = "Where condition not found in delete statement";
errorMessage = "where condition not found in delete statement";
ruleId = "MyBatisMapperCheckRule6";
} else if (sql.startsWith(UPDATE)) {
// Where condition not found in update statement
errorMessage = "Where condition not found in update statement";
errorMessage = "where condition not found in update statement";
ruleId = "MyBatisMapperCheckRule5";
} else if (sql.startsWith(SELECT) && !containsFunctionOrLimit(sql)) {
// Where condition not found in select statement
errorMessage = "Where condition not found in select statement";
errorMessage = "where condition not found in select statement";
ruleId = "MyBatisMapperCheckRule4";
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/mybatis/mybatislint-rules.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
</rule>
<rule>
<key>MyBatisMapperCheckRule4</key>
<name>Where condition not found in select statement</name>
<name>where condition not found in select statement</name>
<internalKey>MyBatisMapperCheckRule4</internalKey>
<description>If all parameters in the update statement of Mapper XML file are null,
the sql will not have where condition, then it will select all records from the table, which may lead to
Expand All @@ -67,7 +67,7 @@
</rule>
<rule>
<key>MyBatisMapperCheckRule5</key>
<name>Where condition not found in update statement</name>
<name>where condition not found in update statement</name>
<internalKey>MyBatisMapperCheckRule5</internalKey>
<description>If all parameters in the update statement of Mapper XML file are null,
the sql will not have where condition, then it will update all records from the table, which will result
Expand All @@ -85,7 +85,7 @@
</rule>
<rule>
<key>MyBatisMapperCheckRule6</key>
<name>Where condition not found in delete statement</name>
<name>where condition not found in delete statement</name>
<internalKey>MyBatisMapperCheckRule6</internalKey>
<description>If all parameters in the delete statement of Mapper XML file are null,
the sql will not have where condition, then it will delete all records from the table, which will result
Expand Down

0 comments on commit b9ced2d

Please sign in to comment.