Class NewlineAtEndOfFileCheck

  • All Implemented Interfaces:
    Configurable, Contextualizable, FileSetCheck

    public class NewlineAtEndOfFileCheck
    extends AbstractFileSetCheck

    Checks that there is a newline at the end of each file.

    An example of how to configure the check is:

     <module name="NewlineAtEndOfFile"/>

    This will check against the platform-specific default line separator.

    It is also possible to enforce the use of a specific line-separator across platforms, with the 'lineSeparator' property:

     <module name="NewlineAtEndOfFile">
       <property name="lineSeparator" value="lf"/>
     </module>

    Valid values for the 'lineSeparator' property are 'system' (system default), 'crlf' (windows), 'cr' (mac), 'lf' (unix) and 'lf_cr_crlf' (lf, cr or crlf).

    Author:
    Christopher Lenz, lkuehne