File tree Expand file tree Collapse file tree 6 files changed +25
-2
lines changed
lib/src/main/java/com/diffplug/spotless/java
main/resources/java/importsorter
test/java/com/diffplug/spotless/java Expand file tree Collapse file tree 6 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
19
19
* Better suggested messages when user's default is set by JVM limitation. ([ #995 ] ( https://github.com/diffplug/spotless/pull/995 ) )
20
20
### Fixed
21
21
* Support ` ktlint ` 0.48+ new rule disabling syntax ([ #1456 ] ( https://github.com/diffplug/spotless/pull/1456 ) ) fixes ([ #1444 ] ( https://github.com/diffplug/spotless/issues/1444 ) )
22
+ * Fix subgroups leading catch all matcher.
22
23
### Changes
23
24
* Bump default version for ` prettier ` from ` 2.0.5 ` to ` 2.8.1 ` ([ #1453 ] ( https://github.com/diffplug/spotless/pull/1453 ) )
24
25
* Bump the dev version of Gradle from ` 7.5.1 ` to ` 7.6 ` ([ #1409 ] ( https://github.com/diffplug/spotless/pull/1409 ) )
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2016-2022 DiffPlug
2
+ * Copyright 2016-2023 DiffPlug
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -45,7 +45,7 @@ private static class ImportsGroup {
45
45
private final List <String > subGroups ;
46
46
47
47
public ImportsGroup (String importOrder ) {
48
- this .subGroups = Stream .of (importOrder .split ("\\ " + SUBGROUP_SEPARATOR ))
48
+ this .subGroups = Stream .of (importOrder .split ("\\ " + SUBGROUP_SEPARATOR , - 1 ))
49
49
.map (this ::normalizeStatic )
50
50
.collect (Collectors .toList ());
51
51
}
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
12
12
### Fixed
13
13
* Prevent tool configurations from being resolved outside project ([ #1447 ] ( https://github.com/diffplug/spotless/pull/1447 ) fixes [ #1215 ] ( https://github.com/diffplug/spotless/issues/1215 ) )
14
14
* Support ` ktlint ` 0.48+ new rule disabling syntax ([ #1456 ] ( https://github.com/diffplug/spotless/pull/1456 ) ) fixes ([ #1444 ] ( https://github.com/diffplug/spotless/issues/1444 ) )
15
+ * Fix subgroups leading catch all matcher.
15
16
### Changes
16
17
* Bump default ` ktlint ` version to latest ` 0.47.1 ` -> ` 0.48.1 ` ([ #1456 ] ( https://github.com/diffplug/spotless/pull/1456 ) )
17
18
* Bump default version for ` prettier ` from ` 2.0.5 ` to ` 2.8.1 ` ([ #1453 ] ( https://github.com/diffplug/spotless/pull/1453 ) )
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
13
13
* Better suggested messages when user's default is set by JVM limitation. ([ #995 ] ( https://github.com/diffplug/spotless/pull/995 ) )
14
14
### Fixed
15
15
* Support ` ktlint ` 0.48+ new rule disabling syntax ([ #1456 ] ( https://github.com/diffplug/spotless/pull/1456 ) ) fixes ([ #1444 ] ( https://github.com/diffplug/spotless/issues/1444 ) )
16
+ * Fix subgroups leading catch all matcher.
16
17
### Changes
17
18
* Bump default ` ktlint ` version to latest ` 0.47.1 ` -> ` 0.48.1 ` ([ #1456 ] ( https://github.com/diffplug/spotless/pull/1456 ) )
18
19
* Reduce spurious invalidations of the up-to-date index file ([ #1461 ] ( https://github.com/diffplug/spotless/pull/1461 ) )
Original file line number Diff line number Diff line change
1
+ import static com.foo.Bar;
2
+ import static com.github.tomakehurst.wiremock.client.WireMock.*;
3
+ import static com.github.tomakehurst.wiremock.client.WireMock.equalTo;
4
+ import static java.lang.Exception.*;
5
+ import static java.lang.Runnable.*;
6
+ import static org.hamcrest.Matchers.*;
7
+ import java.awt.*;
8
+ import java.lang.Runnable;
9
+ import java.lang.Thread;
10
+ import java.util.*;
11
+ import java.util.List;
12
+ import javax.annotation.Nullable;
13
+ import javax.inject.Inject;
14
+ import org.dooda.Didoo;
Original file line number Diff line number Diff line change @@ -41,6 +41,12 @@ void sortImportsFromArrayWithSubgroups() {
41
41
StepHarness .forStep (step ).testResource ("java/importsorter/JavaCodeUnsortedImportsSubgroups.test" , "java/importsorter/JavaCodeSortedImportsSubgroups.test" );
42
42
}
43
43
44
+ @ Test
45
+ void sortImportsFromArrayWithSubgroupsLeadingCatchAll () {
46
+ FormatterStep step = ImportOrderStep .forJava ().createFrom ("\\ #|" );
47
+ StepHarness .forStep (step ).testResource ("java/importsorter/JavaCodeUnsortedImportsSubgroups.test" , "java/importsorter/JavaCodeSortedImportsSubgroupsLeadingCatchAll.test" );
48
+ }
49
+
44
50
@ Test
45
51
void sortImportsFromFile () {
46
52
FormatterStep step = ImportOrderStep .forJava ().createFrom (createTestFile ("java/importsorter/import.properties" ));
You can’t perform that action at this time.
0 commit comments