Skip to content

Files

Latest commit

 

History

History
55 lines (36 loc) · 1.19 KB

ClassEndsWithBlankLine.md

File metadata and controls

55 lines (36 loc) · 1.19 KB

Pattern: Class ends with blank line

Issue: -

Description

Checks whether the class ends with a blank line. By default, it enforces that there must be a blank line before the closing class brace, except if the class is empty and is written in a single line. A blank line is defined as any line that does not contain any visible characters.

Examples of violations:

If ignoreSingleLineClasses is true and blankLineRequired is true

        class Foo {
            int a

            void hi() {
            }
        }

If ignoreSingleLineClasses is false and blankLineRequired is true

        class Foo extends Bar<String> { }

If ignoreSingleLineClasses is true and blankLineRequired is false

        class Foo {
            int a

            void hi() {
            }

        }

If ignoreSingleLineClasses is false and blankLineRequired is false

        class Foo {
            int a

            void hi() {
            }

        }

Further Reading