Skip to content

Commit a91bafd

Browse files
committed
Merge remote-tracking branch 'origin/main' into AddLogSynthesysAfterApplyInMaven
2 parents c890b89 + f9b0c7b commit a91bafd

File tree

129 files changed

+3124
-1769
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+3124
-1769
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
* text eol=lf
2+
*.bat eol=crlf
23
*.png binary
34
*.jar binary

.github/workflows/changelog-print.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ jobs:
1515
with:
1616
java-version: 11
1717
distribution: 'temurin'
18-
cache: 'gradle'
1918
- name: gradle caching
2019
uses: gradle/gradle-build-action@v2
20+
with:
21+
gradle-home-cache-cleanup: true
2122
- run: ./gradlew changelogPrint

.github/workflows/ci.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ jobs:
2626
with:
2727
distribution: "temurin"
2828
java-version: 11
29-
cache: gradle
29+
- name: gradle caching
30+
uses: gradle/gradle-build-action@v2
31+
with:
32+
gradle-home-cache-cleanup: true
3033
- name: spotlessCheck
3134
run: ./gradlew spotlessCheck --build-cache
3235
- name: assemble testClasses
@@ -37,19 +40,19 @@ jobs:
3740
fail-fast: false
3841
matrix:
3942
kind: [maven, gradle]
40-
jre: [8, 11, 17]
43+
jre: [11, 17]
4144
os: [ubuntu-latest]
4245
include:
4346
# test windows at the diagonals of the above matrix
4447
- kind: maven
45-
jre: 8
48+
jre: 11
4649
os: windows-latest
4750
- kind: gradle
4851
jre: 17
4952
os: windows-latest
5053
# npm on linux only (crazy slow on windows)
5154
- kind: npm
52-
jre: 8
55+
jre: 11
5356
os: ubuntu-latest
5457
runs-on: ${{ matrix.os }}
5558
steps:
@@ -60,7 +63,10 @@ jobs:
6063
with:
6164
distribution: "temurin"
6265
java-version: ${{ matrix.jre }}
63-
cache: gradle
66+
- name: gradle caching
67+
uses: gradle/gradle-build-action@v2
68+
with:
69+
gradle-home-cache-cleanup: true
6470
- name: build (maven-only)
6571
if: matrix.kind == 'maven'
6672
run: ./gradlew :plugin-maven:build -x spotlessCheck --build-cache

.github/workflows/deploy.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,12 @@ jobs:
4242
with:
4343
java-version: 11
4444
distribution: 'temurin'
45-
cache: 'gradle'
4645
- name: gradle caching
4746
uses: gradle/gradle-build-action@v2
47+
with:
48+
gradle-home-cache-cleanup: true
49+
- name: git fetch origin main
50+
run: git fetch origin main
4851
- name: publish all
4952
if: "${{ github.event.inputs.to_publish == 'all' }}"
5053
run: |

.github/workflows/gradle-wrapper-validation.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
name: "Validate Gradle Wrapper"
2-
on: [push, pull_request]
2+
on:
3+
push:
4+
paths:
5+
- 'gradlew'
6+
- 'gradlew.bat'
7+
- 'gradle/wrapper/'
8+
pull_request:
9+
paths:
10+
- 'gradlew'
11+
- 'gradlew.bat'
12+
- 'gradle/wrapper/'
313

414
permissions:
515
contents: read

CHANGES.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,32 @@ 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+
### Changes
14+
* **POTENTIALLY BREAKING** Bump bytecode from Java 8 to 11 ([#1530](https://github.com/diffplug/spotless/pull/1530) part 2 of [#1337](https://github.com/diffplug/spotless/issues/1337))
15+
16+
## [2.34.0] - 2023-01-26
17+
### Added
18+
* `Formatter` now has a field `public static final File NO_FILE_SENTINEL` which can be used to pass string content to a Formatter or FormatterStep when there is no actual File to format. ([#1525](https://github.com/diffplug/spotless/pull/1525))
19+
20+
## [2.33.0] - 2023-01-26
1321
### Added
1422
* `ProcessRunner` has added some convenience methods so it can be used for maven testing. ([#1496](https://github.com/diffplug/spotless/pull/1496))
23+
* `ProcessRunner` allows to limit captured output to a certain number of bytes. ([#1511](https://github.com/diffplug/spotless/pull/1511))
24+
* `ProcessRunner` is now capable of handling long-running tasks where waiting for exit is delegated to the caller. ([#1511](https://github.com/diffplug/spotless/pull/1511))
25+
* Allow to specify node executable for node-based formatters using `nodeExecutable` parameter ([#1500](https://github.com/diffplug/spotless/pull/1500))
1526
### Fixed
1627
* The default list of type annotations used by `formatAnnotations` has had 8 more annotations from the Checker Framework added [#1494](https://github.com/diffplug/spotless/pull/1494)
1728
### Changes
29+
* **POTENTIALLY BREAKING** Bump minimum JRE from 8 to 11, next release likely to bump bytecode to Java 11 ([#1514](https://github.com/diffplug/spotless/pull/1514) part 1 of [#1337](https://github.com/diffplug/spotless/issues/1337))
30+
* Rename `YamlJacksonStep` into `JacksonYamlStep` while normalizing Jackson usage ([#1492](https://github.com/diffplug/spotless/pull/1492))
31+
* Convert `gson` integration to use a compile-only source set ([#1510](https://github.com/diffplug/spotless/pull/1510)).
32+
* ** POTENTIALLY BREAKING** Removed support for KtLint 0.3x and 0.45.2 ([#1475](https://github.com/diffplug/spotless/pull/1475))
33+
* `KtLint` does not maintain a stable API - before this PR, we supported every breaking change in the API since 2019.
34+
* From now on, we will support no more than 2 breaking changes at a time.
35+
* NpmFormatterStepStateBase delays `npm install` call until the formatter is first used. This enables better integration
36+
with `gradle-node-plugin`. ([#1522](https://github.com/diffplug/spotless/pull/1522))
37+
* Bump default `ktlint` version to latest `0.48.1` -> `0.48.2` ([#1529](https://github.com/diffplug/spotless/pull/1529))
38+
* Bump default `scalafmt` version to latest `3.6.1` -> `3.7.1` ([#1529](https://github.com/diffplug/spotless/pull/1529))
1839

1940
## [2.32.0] - 2023-01-13
2041
### Added

README.md

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,45 @@
11
# <img align="left" src="_images/spotless_logo.png"> Spotless: Keep your code spotless
22

3-
<!---freshmark shields
4-
output = [
5-
link(image('Circle CI', 'https://circleci.com/gh/diffplug/spotless/tree/main.svg?style=shield'), 'https://circleci.com/gh/diffplug/spotless/tree/main'),
6-
link(shield('Live chat', 'gitter', 'chat', 'brightgreen'), 'https://gitter.im/{{org}}/{{name}}'),
7-
link(shield('License Apache', 'license', 'apache', 'brightgreen'), 'https://tldrlegal.com/license/apache-license-2.0-(apache-2.0)')
8-
].join('\n');
9-
-->
10-
[![Circle CI](https://circleci.com/gh/diffplug/spotless/tree/main.svg?style=shield)](https://circleci.com/gh/diffplug/spotless/tree/main)
11-
[![Live chat](https://img.shields.io/badge/gitter-chat-brightgreen.svg)](https://gitter.im/diffplug/spotless)
12-
[![License Apache](https://img.shields.io/badge/license-apache-brightgreen.svg)](https://tldrlegal.com/license/apache-license-2.0-(apache-2.0))
13-
<!---freshmark /shields -->
3+
[![Gradle Plugin](https://img.shields.io/gradle-plugin-portal/v/com.diffplug.spotless?color=blue&label=gradle%20plugin)](plugin-gradle)
4+
[![Maven Plugin](https://img.shields.io/maven-central/v/com.diffplug.spotless/spotless-maven-plugin?color=blue&label=maven%20plugin)](plugin-maven)
5+
[![SBT Plugin](https://img.shields.io/badge/sbt%20plugin-0.1.3-blue)](https://github.com/moznion/sbt-spotless)
146

15-
Spotless can format &lt;antlr | c | c# | c++ | css | flow | graphql | groovy | html | java | javascript | json | jsx | kotlin | less | license headers | markdown | objective-c | protobuf | python | scala | scss | sql | typeScript | vue | yaml | anything> using &lt;gradle | maven | anything>.
7+
Spotless can format &lt;antlr | c | c# | c++ | css | flow | graphql | groovy | html | java | javascript | json | jsx | kotlin | less | license headers | markdown | objective-c | protobuf | python | scala | scss | sql | typeScript | vue | yaml | anything> using &lt;gradle | maven | sbt | anything>.
168

179
You probably want one of the links below:
1810

1911
## [❇️ Spotless for Gradle](plugin-gradle) (with integrations for [VS Code](https://marketplace.visualstudio.com/items?itemName=richardwillis.vscode-spotless-gradle) and [IntelliJ](https://plugins.jetbrains.com/plugin/18321-spotless-gradle))
12+
13+
```console
14+
user@machine repo % ./gradlew build
15+
:spotlessJavaCheck FAILED
16+
The following files had format violations:
17+
src\main\java\com\diffplug\gradle\spotless\FormatExtension.java
18+
-\t\t····if·(targets.length·==·0)·{
19+
+\t\tif·(targets.length·==·0)·{
20+
Run './gradlew spotlessApply' to fix these violations.
21+
user@machine repo % ./gradlew spotlessApply
22+
:spotlessApply
23+
BUILD SUCCESSFUL
24+
user@machine repo % ./gradlew build
25+
BUILD SUCCESSFUL
26+
```
27+
2028
## [❇️ Spotless for Maven](plugin-maven)
29+
30+
```console
31+
user@machine repo % mvn spotless:check
32+
[ERROR] > The following files had format violations:
33+
[ERROR] src\main\java\com\diffplug\gradle\spotless\FormatExtension.java
34+
[ERROR] -\t\t····if·(targets.length·==·0)·{
35+
[ERROR] +\t\tif·(targets.length·==·0)·{
36+
[ERROR] Run 'mvn spotless:apply' to fix these violations.
37+
user@machine repo % mvn spotless:apply
38+
[INFO] BUILD SUCCESS
39+
user@machine repo % mvn spotless:check
40+
[INFO] BUILD SUCCESS
41+
```
42+
2143
## [❇️ Spotless for SBT (external for now)](https://github.com/moznion/sbt-spotless)
2244
## [Other build systems](CONTRIBUTING.md#how-to-add-a-new-plugin-for-a-build-system)
2345

@@ -63,6 +85,7 @@ lib('java.RemoveUnusedImportsStep') +'{{yes}} | {{yes}}
6385
extra('java.EclipseJdtFormatterStep') +'{{yes}} | {{yes}} | {{yes}} | {{no}} |',
6486
lib('java.FormatAnnotationsStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',
6587
lib('json.gson.GsonStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',
88+
lib('json.JacksonJsonStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',
6689
lib('json.JsonSimpleStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',
6790
lib('kotlin.KtLintStep') +'{{yes}} | {{yes}} | {{yes}} | {{no}} |',
6891
lib('kotlin.KtfmtStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',
@@ -77,7 +100,7 @@ lib('python.BlackStep') +'{{yes}} | {{no}}
77100
lib('scala.ScalaFmtStep') +'{{yes}} | {{yes}} | {{yes}} | {{no}} |',
78101
lib('sql.DBeaverSQLFormatterStep') +'{{yes}} | {{yes}} | {{yes}} | {{no}} |',
79102
extra('wtp.EclipseWtpFormatterStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',
80-
lib('yaml.YamlJacksonStep') +'{{no}} | {{yes}} | {{no}} | {{no}} |',
103+
lib('yaml.JacksonYamlStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',
81104
'| [(Your FormatterStep here)](CONTRIBUTING.md#how-to-add-a-new-formatterstep) | {{no}} | {{no}} | {{no}} | {{no}} |',
82105
].join('\n');
83106
-->
@@ -109,6 +132,7 @@ lib('yaml.YamlJacksonStep') +'{{no}} | {{yes}}
109132
| [`java.EclipseJdtFormatterStep`](lib-extra/src/main/java/com/diffplug/spotless/extra/java/EclipseJdtFormatterStep.java) | :+1: | :+1: | :+1: | :white_large_square: |
110133
| [`java.FormatAnnotationsStep`](lib/src/main/java/com/diffplug/spotless/java/FormatAnnotationsStep.java) | :+1: | :+1: | :white_large_square: | :white_large_square: |
111134
| [`json.gson.GsonStep`](lib/src/main/java/com/diffplug/spotless/json/gson/GsonStep.java) | :+1: | :+1: | :white_large_square: | :white_large_square: |
135+
| [`json.JacksonJsonStep`](lib/src/main/java/com/diffplug/spotless/json/JacksonJsonStep.java) | :+1: | :+1: | :white_large_square: | :white_large_square: |
112136
| [`json.JsonSimpleStep`](lib/src/main/java/com/diffplug/spotless/json/JsonSimpleStep.java) | :+1: | :+1: | :white_large_square: | :white_large_square: |
113137
| [`kotlin.KtLintStep`](lib/src/main/java/com/diffplug/spotless/kotlin/KtLintStep.java) | :+1: | :+1: | :+1: | :white_large_square: |
114138
| [`kotlin.KtfmtStep`](lib/src/main/java/com/diffplug/spotless/kotlin/KtfmtStep.java) | :+1: | :+1: | :white_large_square: | :white_large_square: |
@@ -123,7 +147,7 @@ lib('yaml.YamlJacksonStep') +'{{no}} | {{yes}}
123147
| [`scala.ScalaFmtStep`](lib/src/main/java/com/diffplug/spotless/scala/ScalaFmtStep.java) | :+1: | :+1: | :+1: | :white_large_square: |
124148
| [`sql.DBeaverSQLFormatterStep`](lib/src/main/java/com/diffplug/spotless/sql/DBeaverSQLFormatterStep.java) | :+1: | :+1: | :+1: | :white_large_square: |
125149
| [`wtp.EclipseWtpFormatterStep`](lib-extra/src/main/java/com/diffplug/spotless/extra/wtp/EclipseWtpFormatterStep.java) | :+1: | :+1: | :white_large_square: | :white_large_square: |
126-
| [`yaml.YamlJacksonStep`](lib/src/main/java/com/diffplug/spotless/yaml/YamlJacksonStep.java) | :white_large_square: | :+1: | :white_large_square: | :white_large_square: |
150+
| [`yaml.JacksonYamlStep`](lib/src/main/java/com/diffplug/spotless/yaml/JacksonYamlStep.java) | :+1: | :+1: | :white_large_square: | :white_large_square: |
127151
| [(Your FormatterStep here)](CONTRIBUTING.md#how-to-add-a-new-formatterstep) | :white_large_square: | :white_large_square: | :white_large_square: | :white_large_square: |
128152
<!---freshmark /matrix -->
129153

_ext/eclipse-wtp/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ sourceSets {
100100
* All test classes need to run separately since they all instatiate different setups of the
101101
* Eclipse framework.
102102
*/
103-
test {
103+
tasks.withType(Test).configureEach {
104104
//Skip default tests, which would run every test case.
105105
exclude '**'
106106
}

_ext/gradle/java-setup.gradle

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ apply from: rootProject.file('gradle/java-setup.gradle')
99
apply plugin: 'java-library'
1010

1111
// Show warning locations, fail on warnings
12-
tasks.withType(JavaCompile) {
12+
tasks.withType(JavaCompile).configureEach {
1313
options.compilerArgs << "-Xlint:unchecked"
1414
options.compilerArgs << "-Xlint:deprecation"
1515
options.compilerArgs << "-Werror"
@@ -22,4 +22,6 @@ dependencies {
2222
testImplementation project(':testlib')
2323
}
2424

25-
test { useJUnitPlatform() }
25+
tasks.withType(Test).configureEach {
26+
useJUnitPlatform()
27+
}

_ext/gradle/update-lockfile.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Use file locking
2-
configurations.all {
2+
configurations.configureEach {
33
resolutionStrategy {
44
activateDependencyLocking()
55
}
6-
}
6+
}

0 commit comments

Comments
 (0)