Skip to content

Commit 98910ef

Browse files
committed
Merge remote-tracking branch 'origin/main' into js-ts-rome
2 parents 971824d + 3d528f0 commit 98910ef

File tree

10 files changed

+27
-20
lines changed

10 files changed

+27
-20
lines changed

CHANGES.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ This document is intended for Spotless developers.
1010
We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (starting after version `1.27.0`).
1111

1212
## [Unreleased]
13-
14-
* * Support Rome as a formatter for JavaScript and TypeScript code. Adds a new `rome` step to `javascript` and `typescript` formatter configurations. https://github.com/diffplug/spotless/pull/1663
13+
### Added
14+
* `Jvm.Support` now accepts `-SNAPSHOT` versions, treated as the non`-SNAPSHOT`. ([#1583](https://github.com/diffplug/spotless/issues/1583))
15+
* Support Rome as a formatter for JavaScript and TypeScript code. Adds a new `rome` step to `javascript` and `typescript` formatter configurations. https://github.com/diffplug/spotless/pull/1663
1516

1617
## [2.38.0] - 2023-04-06
1718
### Added

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ VER_DURIAN=1.2.0
3232
VER_JGIT=6.5.0.202303070854-r
3333
VER_JUNIT=5.9.2
3434
VER_ASSERTJ=3.24.2
35-
VER_MOCKITO=5.2.0
35+
VER_MOCKITO=5.3.0

lib/src/main/java/com/diffplug/spotless/Jvm.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,11 @@ public int compare(V version0, V version1) {
280280

281281
private static <V> int[] convert(V versionObject) {
282282
try {
283-
return Arrays.asList(versionObject.toString().split("\\.")).stream().mapToInt(Integer::parseInt).toArray();
283+
String versionString = versionObject.toString();
284+
if (versionString.endsWith("-SNAPSHOT")) {
285+
versionString = versionString.substring(0, versionString.length() - "-SNAPSHOT".length());
286+
}
287+
return Arrays.asList(versionString.split("\\.")).stream().mapToInt(Integer::parseInt).toArray();
284288
} catch (Exception e) {
285289
throw new IllegalArgumentException(String.format("Not a semantic version: %s", versionObject), e);
286290
}

plugin-gradle/CHANGES.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@
33
We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (starting after version `3.27.0`).
44

55
## [Unreleased]
6-
6+
### Added
77
* Support Rome as a formatter for JavaScript and TypeScript code. Adds a new `rome` step to `javascript` and `typescript` formatter configurations. https://github.com/diffplug/spotless/pull/1663
88

9+
### Fixed
10+
* Added `@DisableCachingByDefault` to `RegisterDependenciesTask`.
11+
912
## [6.18.0] - 2023-04-06
1013
### Added
1114
* `removeUnusedImport` can be configured to rely on `cleanthat-javaparser-unnecessaryimport`. Default remains `google-java-format`. ([#1589](https://github.com/diffplug/spotless/pull/1589))

plugin-gradle/src/main/java/com/diffplug/gradle/spotless/RegisterDependenciesTask.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2022 DiffPlug
2+
* Copyright 2016-2023 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -31,6 +31,7 @@
3131
import org.gradle.api.tasks.OutputFile;
3232
import org.gradle.api.tasks.TaskAction;
3333
import org.gradle.build.event.BuildEventsListenerRegistry;
34+
import org.gradle.work.DisableCachingByDefault;
3435

3536
import com.diffplug.common.base.Preconditions;
3637
import com.diffplug.common.io.Files;
@@ -46,6 +47,7 @@
4647
* - When this "registerDependencies" task does its up-to-date check, it queries the task execution graph to see which
4748
* SpotlessTasks are at risk of being executed, and causes them all to be evaluated safely in the root buildscript.
4849
*/
50+
@DisableCachingByDefault(because = "This task coordinates the setup and execution of other tasks, and should not be cached")
4951
public abstract class RegisterDependenciesTask extends DefaultTask {
5052
static final String TASK_NAME = "spotlessInternalRegisterDependencies";
5153

plugin-maven/CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (starting after version `1.27.0`).
44

55
## [Unreleased]
6+
### Added
67
* Support Rome as a formatter for JavaScript and TypeScript code. Adds a new `rome` step to `javascript` and `typescript` formatter configurations. https://github.com/diffplug/spotless/pull/1663### Fixed
78

89
## [2.36.0] - 2023-04-06

plugin-maven/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ Additionally, `editorConfigOverride` options will override what's supplied in `.
459459
<scalafmt>
460460
<version>3.5.9</version> <!-- optional -->
461461
<file>${project.basedir}/scalafmt.conf</file> <!-- optional -->
462-
<majorScalaVersion>2.13</majorScalaVersion> <!-- optional -->
462+
<scalaMajorVersion>2.13</scalaMajorVersion> <!-- optional -->
463463
</scalafmt>
464464
```
465465

plugin-maven/src/test/java/com/diffplug/spotless/maven/java/CleanthatJavaRefactorerTest.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,14 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package com.diffplug.spotless.maven.test;
16+
package com.diffplug.spotless.maven.java;
1717

1818
import org.assertj.core.api.Assertions;
1919
import org.junit.jupiter.api.Test;
20-
import org.slf4j.Logger;
21-
import org.slf4j.LoggerFactory;
2220

2321
import com.diffplug.spotless.maven.MavenIntegrationHarness;
2422

2523
class CleanthatJavaRefactorerTest extends MavenIntegrationHarness {
26-
private static final Logger LOGGER = LoggerFactory.getLogger(CleanthatJavaRefactorerTest.class);
27-
2824
@Test
2925
void testEnableDraft() throws Exception {
3026
writePomWithJavaSteps(

settings.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ pluginManagement {
66
}
77

88
plugins {
9-
id 'com.diffplug.spotless' version '6.17.0' apply false
9+
id 'com.diffplug.spotless' version '6.18.0' apply false
1010
// https://plugins.gradle.org/plugin/com.gradle.plugin-publish
11-
id 'com.gradle.plugin-publish' version '1.1.0' apply false
11+
id 'com.gradle.plugin-publish' version '1.2.0' apply false
1212
// https://github.com/gradle-nexus/publish-plugin/releases
1313
id 'io.github.gradle-nexus.publish-plugin' version '1.3.0' apply false
1414
// https://github.com/spotbugs/spotbugs-gradle-plugin/releases
1515
id 'com.github.spotbugs' version '5.0.14' apply false
1616
// https://github.com/diffplug/spotless-changelog/blob/main/CHANGELOG.md
17-
id 'com.diffplug.spotless-changelog' version '3.0.1' apply false
17+
id 'com.diffplug.spotless-changelog' version '3.0.2' apply false
1818
// https://github.com/diffplug/goomph/blob/main/CHANGES.md
1919
// DO NOT UPDATE, see https://github.com/diffplug/spotless/pull/874
2020
id 'com.diffplug.p2.asmaven' version '3.27.0' apply false
@@ -23,7 +23,7 @@ plugins {
2323
// https://github.com/davidburstrom/version-compatibility-gradle-plugin/tags
2424
id 'io.github.davidburstrom.version-compatibility' version '0.5.0' apply false
2525
// https://plugins.gradle.org/plugin/com.gradle.enterprise
26-
id 'com.gradle.enterprise' version '3.12.6'
26+
id 'com.gradle.enterprise' version '3.13'
2727
// https://github.com/equodev/equo-ide/blob/main/plugin-gradle/CHANGELOG.md
2828
id 'dev.equo.ide' version '1.0.1' apply false
2929
}

testlib/src/test/java/com/diffplug/spotless/JvmTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ void supportListsMinimumJvmIfOnlyHigherJvmSupported() {
9393

9494
assertNull(testSupport.getRecommendedFormatterVersion(), "No formatter version is supported");
9595

96-
for (String fmtVersion : Arrays.asList("1.2", "1.2.3")) {
96+
for (String fmtVersion : Arrays.asList("1.2", "1.2.3", "1.2-SNAPSHOT", "1.2.3-SNAPSHOT")) {
9797
String proposal = assertThrows(Exception.class, () -> {
9898
testSupport.assertFormatterSupported(fmtVersion);
9999
}).getMessage();
@@ -111,7 +111,7 @@ void supportListsMinimumJvmIfOnlyHigherJvmSupported() {
111111
assertThat(proposal).contains(String.format("try %s alternatives", TEST_NAME));
112112
}
113113

114-
for (String fmtVersion : Arrays.asList("1.2.4", "2")) {
114+
for (String fmtVersion : Arrays.asList("1.2.4", "2", "1.2.5-SNAPSHOT")) {
115115
String proposal = assertThrows(Exception.class, () -> {
116116
testSupport.assertFormatterSupported(fmtVersion);
117117
}).getMessage();
@@ -132,7 +132,7 @@ void supportProposesFormatterUpgrade() {
132132
testSupport.add(Jvm.version() - 2, "1");
133133
testSupport.add(requiredJvm, "2");
134134
testSupport.add(Jvm.version() + 1, "3");
135-
for (String fmtVersion : Arrays.asList("0", "1", "1.9")) {
135+
for (String fmtVersion : Arrays.asList("0", "1", "1.9", "1.9-SNAPSHOT")) {
136136
testSupport.assertFormatterSupported(fmtVersion);
137137

138138
String proposal = assertThrows(Exception.class, () -> {
@@ -168,7 +168,7 @@ void supportProposesJvmUpgrade() {
168168
@Test
169169
void supportAllowsExperimentalVersions() {
170170
testSupport.add(Jvm.version(), "1.0");
171-
for (String fmtVersion : Arrays.asList("1", "2.0")) {
171+
for (String fmtVersion : Arrays.asList("1", "2.0", "1.1-SNAPSHOT", "2.0-SNAPSHOT")) {
172172
testSupport.assertFormatterSupported(fmtVersion);
173173

174174
Exception testException = new Exception("Some test exception");

0 commit comments

Comments
 (0)