Package com.qulice.checkstyle
Class EmptyLinesCheck
- java.lang.Object
-
- com.puppycrawl.tools.checkstyle.AbstractAutomaticBean
-
- com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
-
- com.puppycrawl.tools.checkstyle.api.AbstractCheck
-
- com.qulice.checkstyle.EmptyLinesCheck
-
- All Implemented Interfaces:
com.puppycrawl.tools.checkstyle.api.Configurable,com.puppycrawl.tools.checkstyle.api.Contextualizable
public final class EmptyLinesCheck extends com.puppycrawl.tools.checkstyle.api.AbstractCheckCheck for empty lines inside methods and constructors.We believe that comments and empty lines are evil. If you need to use an empty line in order to add a vertical separator of concepts - refactor your code and make it more cohesive and readable. The bottom line is that every method should look solid and do just one thing. This class is thread safe. It relies on building a list of line ranges by visiting each method definition and each anonymous inner type. It stores these references in a non-static thread local.
- Since:
- 0.3
-
-
Constructor Summary
Constructors Constructor Description EmptyLinesCheck()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfinishTree(com.puppycrawl.tools.checkstyle.api.DetailAST root)int[]getAcceptableTokens()int[]getDefaultTokens()int[]getRequiredTokens()voidvisitToken(com.puppycrawl.tools.checkstyle.api.DetailAST ast)-
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractCheck
beginTree, clearViolations, destroy, getFileContents, getFilePath, getLine, getLineCodePoints, getLines, getTabWidth, getTokenNames, getViolations, init, isCommentNodesRequired, leaveToken, log, log, log, setFileContents, setTabWidth, setTokens
-
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
finishLocalSetup, getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, setId, setSeverity
-
-
-
-
Method Detail
-
getDefaultTokens
public int[] getDefaultTokens()
- Specified by:
getDefaultTokensin classcom.puppycrawl.tools.checkstyle.api.AbstractCheck
-
getAcceptableTokens
public int[] getAcceptableTokens()
- Specified by:
getAcceptableTokensin classcom.puppycrawl.tools.checkstyle.api.AbstractCheck
-
getRequiredTokens
public int[] getRequiredTokens()
- Specified by:
getRequiredTokensin classcom.puppycrawl.tools.checkstyle.api.AbstractCheck
-
visitToken
public void visitToken(com.puppycrawl.tools.checkstyle.api.DetailAST ast)
- Overrides:
visitTokenin classcom.puppycrawl.tools.checkstyle.api.AbstractCheck
-
finishTree
public void finishTree(com.puppycrawl.tools.checkstyle.api.DetailAST root)
- Overrides:
finishTreein classcom.puppycrawl.tools.checkstyle.api.AbstractCheck
-
-