Skip to content

Commit

Permalink
#556 review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
HDouss committed Dec 31, 2015
1 parent ffeaf8a commit 2497c42
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,27 @@
* @author Hamdi Douss (douss.hamdi@gmail.com)
* @version $Id$
*/
public final class QuliceIndentationCheck extends AbstractFileSetCheck {
public final class CascadeIndentationCheck extends AbstractFileSetCheck {
/**
* Exact indentation increase difference.
*/
private static final int LINE_INDENT_DIFF = 4;

/**
* {@inheritDoc}
* @checkstyle MagicNumberCheck (13 lines)
*/
@Override
public void processFiltered(final File file, final List<String> lines) {
int previous = 0;
for (int pos = 0; pos < lines.size(); pos += 1) {
final String line = lines.get(pos);
final int current = QuliceIndentationCheck.indentation(line);
if (QuliceIndentationCheck.inCommentBlock(line)
final int current = CascadeIndentationCheck.indentation(line);
if (CascadeIndentationCheck.inCommentBlock(line)
|| line.length() == 0) {
continue;
}
if (current > previous
&& current != previous + 4) {
&& current != previous + LINE_INDENT_DIFF) {
this.log(
pos + 1,
String.format(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@
<module name="com.qulice.checkstyle.ImportCohesionCheck">
<property name="fileExtensions" value="java"/>
</module>
<module name="com.qulice.checkstyle.QuliceIndentationCheck">
<module name="com.qulice.checkstyle.CascadeIndentationCheck">
<property name="fileExtensions" value="java"/>
</module>
<module name="com.qulice.checkstyle.ConditionalRegexpMultilineCheck">
Expand Down

0 comments on commit 2497c42

Please sign in to comment.