Skip to content

add checks for OpenJDK Style §3.8.1 - Wrapping Class Declarations #19743

@Anushreebasics

Description

@Anushreebasics

parent issue #19604

description

Image

Add Checkstyle checks for all rules under §3.8.1 - Wrapping Class Declarations of the OpenJDK Java Style Guidelines v6.

Rules covered

From §3.8.1 - Wrapping Class Declarations:

  1. A class header should not be wrapped unless it approaches the maximum column limit.
    Planned coverage: new Check to validate class declaration should stay on one line by default.

  2. If it is wrapped, wrapping should happen before extends and/or implements.
    Planned coverage: new Check to validate extends and implements start on a new line when class declaration is wrapped.

  3. Declarations of type parameters may, if necessary, be wrapped the same way as method arguments.
    Coverage decision: not enforceable as a strict rule because “if necessary” is discretionary.

Checks to add to openjdk_checks.xml:

  • New check (to be implemented in this issue) for class declaration wrapping rules in §3.8.1.

Progress tracker

rules status
Class header single-line by default
Wrap before extends/implements when wrapped
Type parameter wrapping "if necessary"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions