Skip to content

Commit

Permalink
Merge branch '__rultor'
Browse files Browse the repository at this point in the history
  • Loading branch information
rultor committed Dec 22, 2015
2 parents 2d990c8 + 0f74265 commit 837dba5
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,9 @@
<module name="FinalParameters">
<property name="tokens" value="CTOR_DEF,METHOD_DEF,FOR_EACH_CLAUSE,LITERAL_CATCH"/>
</module>
<module name="Indentation"/>
<module name="Indentation">
<property name="forceStrictCondition" value="true"/>
</module>
<module name="CommentsIndentation"/>
<module name="TrailingComment"/>
<module name="OuterTypeFilename"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,21 @@ public void reportsErrorWhenLineWrap()
);
}

/**
* CheckstyleValidator reports an error when indentation is not strict.
* @throws Exception when error.
*/
@Test
public void reportsErrorWhenIndentationIsNotStrict() throws Exception {
this.validateCheckstyle(
"StrictIndentation.java",
false,
Matchers.containsString(
"incorrect indentation level 14, expected level should be 12"
)
);
}

/**
* CheckstyleValidator reports an error when any method contains more
* than one return statement.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* Hello.
*/
package foo.bar;

/**
* Simple.
* @version $Id$
* @author John Smith (john@example.com)
*/
public class StrictIndentation {
public StrictIndentation() {
final String first = String.format(
"incorrect"
);
final String correct = String.format(
"correct"
);
}
}

0 comments on commit 837dba5

Please sign in to comment.