Class NoCodeInFileCheck

  • All Implemented Interfaces:
    Configurable, Contextualizable

    public class NoCodeInFileCheck
    extends AbstractCheck
    Checks whether file contains code. Java compiler is not raising errors on files with no code or all commented out. Files which are considered to have no code:
    • File with no text
    • File with single-line comment(s)
    • File with a multi line comment(s).

    Parent is com.puppycrawl.tools.checkstyle.TreeWalker

    Violation Message Keys:

    • nocode.in.file
    Since:
    8.33