Skip to content

Commit a65b39c

Browse files
Vincent Potucekromani
authored andcommitted
Issue #17487: Add importOrder
1 parent 37d1206 commit a65b39c

File tree

7 files changed

+43
-15
lines changed

7 files changed

+43
-15
lines changed

config/spotless/import.order

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
3=
2+
2=org
3+
1=javax
4+
0=java

config/spotless/licence.header

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
///////////////////////////////////////////////////////////////////////////////////////////////
2+
// checkstyle: Checks Java source code and other text files for adherence to a set of rules.
3+
// Copyright (C) 2001-$YEAR the original author or authors.
4+
//
5+
// This library is free software; you can redistribute it and/or
6+
// modify it under the terms of the GNU Lesser General Public
7+
// License as published by the Free Software Foundation; either
8+
// version 2.1 of the License, or (at your option) any later version.
9+
//
10+
// This library is distributed in the hope that it will be useful,
11+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13+
// Lesser General Public License for more details.
14+
//
15+
// You should have received a copy of the GNU Lesser General Public
16+
// License along with this library; if not, write to the Free Software
17+
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18+
///////////////////////////////////////////////////////////////////////////////////////////////
19+

pom.xml

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,14 @@
611611
<version>3.0.0</version>
612612
<configuration>
613613
<java>
614+
<forbidWildcardImports />
614615
<removeUnusedImports />
616+
<importOrder>
617+
<file>config/spotless/import.order</file>
618+
</importOrder>
619+
<licenseHeader>
620+
<file>config/spotless/licence.header</file>
621+
</licenseHeader>
615622
</java>
616623
<upToDateChecking>
617624
<enabled>true</enabled>
@@ -1897,22 +1904,24 @@
18971904
<validationSet>
18981905
<dir>config</dir>
18991906
<excludes>
1900-
<exclude>java.header</exclude>
1901-
<exclude>java-regexp.header</exclude>
1902-
<exclude>org.eclipse.jdt.core.prefs</exclude>
1903-
<exclude>intellij-idea-inspections.properties</exclude>
1904-
<exclude>markdownlint.rb</exclude>
1905-
<exclude>signatures.txt</exclude>
1906-
<exclude>signatures-test.txt</exclude>
1907-
<exclude>codenarc-rules.groovy.txt</exclude>
1908-
<!-- until https://github.com/checkstyle/checkstyle/issues/11572 -->
1909-
<exclude>linkcheck-suppressions.txt</exclude>
19101907
<exclude>archunit-store/**</exclude>
1908+
<exclude>codenarc-rules.groovy.txt</exclude>
19111909
<exclude>google-java-format/**</exclude>
1910+
<exclude>intellij-idea-inspections.properties</exclude>
1911+
<exclude>java-regexp.header</exclude>
1912+
<exclude>java.header</exclude>
19121913
<exclude>jsoref-spellchecker/**</exclude>
1914+
<exclude>markdownlint.rb</exclude>
1915+
<exclude>openrewrite-recipes-checkstyle.properties</exclude>
1916+
<exclude>org.eclipse.jdt.core.prefs</exclude>
19131917
<exclude>projects-to-test/**</exclude>
1918+
<exclude>signatures-test.txt</exclude>
1919+
<exclude>signatures.txt</exclude>
1920+
<exclude>spotless/import.order</exclude>
1921+
<exclude>spotless/licence.header</exclude>
19141922
<exclude>yamllint.yaml</exclude>
1915-
<exclude>openrewrite-recipes-checkstyle.properties</exclude>
1923+
<!-- until https://github.com/checkstyle/checkstyle/issues/11572 -->
1924+
<exclude>linkcheck-suppressions.txt</exclude>
19161925
</excludes>
19171926
</validationSet>
19181927
<validationSet>

src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/MultipleStringLiteralsCheck.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,4 +218,3 @@ public void finishTree(DetailAST rootAST) {
218218
}
219219
}
220220
}
221-

src/main/java/com/puppycrawl/tools/checkstyle/meta/XmlMetaWriter.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,4 +190,3 @@ private static void writeToFile(Document document, ModuleDetails moduleDetails)
190190

191191
}
192192
}
193-

src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/MissingNullCaseInSwitchCheckTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,3 @@ public void testMissingNullCaseInSwitchWithPrimitives() throws Exception {
117117
expected);
118118
}
119119
}
120-

src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/AvoidStaticImportCheckTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,4 +160,3 @@ public void testGetAcceptableTokens() {
160160
}
161161

162162
}
163-

0 commit comments

Comments
 (0)