Skip to content

Files

Latest commit

 

History

History
46 lines (31 loc) · 1.16 KB

NoLineWrap.md

File metadata and controls

46 lines (31 loc) · 1.16 KB

Pattern: Statement is line-wrapped

Issue: -

Description

Checks that chosen statements are not line-wrapped. By default this check restricts wrapping import and package statements, but it's possible to check any statement.

Default configuration

<module name="NoLineWrap"/>

Examples

Example of incorrect code:

import com.puppycrawl.tools. //violation
    checkstyle.api.AbstractCheck;

import static java.math. //violation
    BigInteger.ZERO;

Example of correct code:

import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
import static java.math.BigInteger.ZERO;

To configure the check to force no line-wrapping only in import statements:

<module name="NoLineWrap">
    <property name="tokens" value="IMPORT"/>
</module>

Further Reading