Skip to content

doc: add example to ImportOrder about other groups #5982

@romani

Description

@romani

noticed at #5972 (comment)

We need to put this to documentation as it is not obvious.

The code is

import static java.io.File.listRoots;
import static javax.swing.WindowConstants.*;
import static javax.swing.WindowConstants.*;
import static java.io.File.createTempFile;
import static java.io.File.pathSeparator;
import static com.puppycrawl.tools.checkstyle.checks.imports.avoidstaticimport.InputAvoidStaticImportNestedClass.InnerClass;
import static com.puppycrawl.tools.checkstyle.checks.imports.avoidstaticimport.InputAvoidStaticImportNestedClass.InnerClass.one;

when staticGroups="" mean one group, the imports com... should be before java...
The violation is reported.

when staticGroups="java, org" there actually three groups: java*, org* and * (everything else).
In this case, the imports com... should be in the last group. No violation here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions