Package com.qulice.checkstyle
Class EmptyLinesCheck
- java.lang.Object
-
- com.puppycrawl.tools.checkstyle.api.AutomaticBean
-
- com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
-
- com.puppycrawl.tools.checkstyle.api.AbstractCheck
-
- com.qulice.checkstyle.EmptyLinesCheck
-
- All Implemented Interfaces:
Configurable
,Contextualizable
public final class EmptyLinesCheck extends AbstractCheck
Check 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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean
AutomaticBean.OutputStreamOptions
-
-
Constructor Summary
Constructors Constructor Description EmptyLinesCheck()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
finishTree(DetailAST root)
int[]
getAcceptableTokens()
int[]
getDefaultTokens()
int[]
getRequiredTokens()
void
visitToken(DetailAST ast)
-
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractCheck
beginTree, clearMessages, destroy, getClassLoader, getFileContents, getLine, getLines, getMessages, getTabWidth, getTokenNames, init, isCommentNodesRequired, leaveToken, log, log, log, setClassLoader, setFileContents, setTabWidth, setTokens
-
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
finishLocalSetup, getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, setId, setSeverity
-
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean
configure, contextualize, getConfiguration, setupChild
-
-
-
-
Method Detail
-
getDefaultTokens
public int[] getDefaultTokens()
- Specified by:
getDefaultTokens
in classAbstractCheck
-
getAcceptableTokens
public int[] getAcceptableTokens()
- Specified by:
getAcceptableTokens
in classAbstractCheck
-
getRequiredTokens
public int[] getRequiredTokens()
- Specified by:
getRequiredTokens
in classAbstractCheck
-
visitToken
public void visitToken(DetailAST ast)
- Overrides:
visitToken
in classAbstractCheck
-
finishTree
public void finishTree(DetailAST root)
- Overrides:
finishTree
in classAbstractCheck
-
-