Checks for blocks |
![]() |
EmptyBlockDescriptionChecks for empty blocks. Properties
ExamplesTo configure the check:
<module name="EmptyBlock"/>
To configure the check for the text policy and only catch blocks:
<module name="EmptyBlock">
<property name="option" value="text"/>
<property name="tokens" value="LITERAL_CATCH"/>
</module>
Packagecom.puppycrawl.tools.checkstyle.checks Parent ModuleTreeWalker LeftCurly ChecksDescriptionThere are three checks for the placement of left curly braces (' {') for code blocks:
All left curly brace checks have a policy to verify that is specified using property option. Policies eol and nlow take into account property maxLineLength. Properties other than tokens
ExamplesTo configure the OtherLeftCurly check:
<module name="OtherLeftCurly"/>
To configure the MethodLeftCurly check for the nl policy and maximum line length 120:
<module name="MethodLeftCurly">
<property name="option" value="nl"/>
<property name="maxLineLength" value="120"/>
</module>
Packagecom.puppycrawl.tools.checkstyle.checks Parent ModuleTreeWalker NeedBracesDescriptionChecks for braces around code blocks. Properties
ExamplesTo configure the check:
<module name="NeedBraces"/>
To configure the check for if and else blocks:
<module name="NeedBraces">
<property name="tokens" value="LITERAL_IF, LITERAL_ELSE"/>
</module>
Packagecom.puppycrawl.tools.checkstyle.checks Parent ModuleTreeWalker RightCurlyDescriptionChecks the placement of right curly braces ('}') for else, try, and catch tokens. The policy to verify is specified using property option. Properties
ExamplesTo configure the check:
<module name="RightCurly"/>
To configure the check with policy alone for else tokens:
<module name="RightCurly">
<property name="option" value="alone"/>
<property name="tokens" value="LITERAL_ELSE"/>
</module>
Packagecom.puppycrawl.tools.checkstyle.checks Parent ModuleTreeWalker |
Copyright © 2002 Oliver Burn. All rights Reserved.