Skip to content

Commit 9a0932e

Browse files
committed
Merge branch 'main' of https://github.com/diffplug/spotless into feature/eslint-npm
# Conflicts: # CHANGES.md # plugin-gradle/CHANGES.md # plugin-maven/CHANGES.md # plugin-maven/README.md
2 parents 98c023b + 4ee53aa commit 9a0932e

File tree

43 files changed

+814
-486
lines changed

Some content is hidden

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

43 files changed

+814
-486
lines changed

.circleci/config.yml

-217
Original file line numberDiff line numberDiff line change
@@ -140,121 +140,6 @@ jobs:
140140
path: lib-extra/build/test-results/test
141141
- store_test_results:
142142
path: plugin-gradle/build/test-results/test
143-
changelog_print:
144-
<< : *env_gradle
145-
steps:
146-
- checkout
147-
- *restore_cache_wrapper
148-
- *restore_cache_deps
149-
- run:
150-
name: gradlew changelogPrint
151-
command: ./gradlew changelogPrint
152-
do_release_all:
153-
<< : *env_gradle
154-
steps:
155-
- checkout
156-
- *restore_cache_wrapper
157-
- *restore_cache_deps
158-
- *set_git_origin_to_https
159-
- run:
160-
name: gradlew :changelogPush
161-
command: ./gradlew :changelogPush -Prelease=true --stacktrace --warning-mode all
162-
- run:
163-
name: gradlew :plugin-gradle:changelogPush
164-
command: ./gradlew :plugin-gradle:changelogPush -Prelease=true -Pgradle.publish.key=${gradle_key} -Pgradle.publish.secret=${gradle_secret} --stacktrace --warning-mode all
165-
- run:
166-
name: gradlew :plugin-maven:changelogPush
167-
command: ./gradlew :plugin-maven:changelogPush -Prelease=true --stacktrace --warning-mode all
168-
do_release_lib:
169-
<< : *env_gradle
170-
steps:
171-
- checkout
172-
- *restore_cache_wrapper
173-
- *restore_cache_deps
174-
- *set_git_origin_to_https
175-
- run:
176-
name: gradlew :changelogPush
177-
command: ./gradlew :changelogPush -Prelease=true --stacktrace --warning-mode all
178-
do_release_plugin_gradle:
179-
<< : *env_gradle
180-
steps:
181-
- checkout
182-
- *restore_cache_wrapper
183-
- *restore_cache_deps
184-
- *set_git_origin_to_https
185-
- run:
186-
name: gradlew :plugin-gradle:changelogPush
187-
command: ./gradlew :plugin-gradle:changelogPush -Prelease=true -Pgradle.publish.key=${gradle_key} -Pgradle.publish.secret=${gradle_secret} --stacktrace
188-
do_release_plugin_maven:
189-
<< : *env_gradle
190-
steps:
191-
- checkout
192-
- *restore_cache_wrapper
193-
- *restore_cache_deps
194-
- *set_git_origin_to_https
195-
- run:
196-
name: gradlew :plugin-maven:changelogPush
197-
command: ./gradlew :plugin-maven:changelogPush -Prelease=true --stacktrace
198-
ext_changelog_print:
199-
<< : *env_gradle
200-
steps:
201-
- checkout
202-
- *restore_cache_wrapper
203-
- *restore_cache_deps
204-
- *set_git_origin_to_https
205-
- run:
206-
name: gradlew -Pcom.diffplug.spotless.include.ext.nop2=true changelogPrint
207-
command: ./gradlew -Pcom.diffplug.spotless.include.ext.nop2=true changelogPrint
208-
ext_do_release_base:
209-
<< : *env_gradle
210-
steps:
211-
- checkout
212-
- *restore_cache_wrapper
213-
- *restore_cache_deps
214-
- *set_git_origin_to_https
215-
- run:
216-
name: gradlew :eclipse-base:changelogPush
217-
command: ./gradlew -Pcom.diffplug.spotless.include.ext.nop2=true :eclipse-base:changelogPush -Prelease=true --stacktrace
218-
ext_do_release_jdt:
219-
<< : *env_gradle
220-
steps:
221-
- checkout
222-
- *restore_cache_wrapper
223-
- *restore_cache_deps
224-
- *set_git_origin_to_https
225-
- run:
226-
name: gradlew :eclipse-jdt:changelogPush
227-
command: ./gradlew -Pcom.diffplug.spotless.include.ext.nop2=true :eclipse-jdt:changelogPush -Prelease=true --stacktrace
228-
ext_do_release_cdt:
229-
<< : *env_gradle
230-
steps:
231-
- checkout
232-
- *restore_cache_wrapper
233-
- *restore_cache_deps
234-
- *set_git_origin_to_https
235-
- run:
236-
name: gradlew :eclipse-cdt:changelogPush
237-
command: ./gradlew -Pcom.diffplug.spotless.include.ext.cdt=true :eclipse-cdt:changelogPush -Prelease=true --stacktrace
238-
ext_do_release_groovy:
239-
<< : *env_gradle
240-
steps:
241-
- checkout
242-
- *restore_cache_wrapper
243-
- *restore_cache_deps
244-
- *set_git_origin_to_https
245-
- run:
246-
name: gradlew :eclipse-groovy:changelogPush
247-
command: ./gradlew -Pcom.diffplug.spotless.include.ext.groovy=true :eclipse-groovy:changelogPush -Prelease=true --stacktrace
248-
ext_do_release_wtp:
249-
<< : *env_gradle
250-
steps:
251-
- checkout
252-
- *restore_cache_wrapper
253-
- *restore_cache_deps
254-
- *set_git_origin_to_https
255-
- run:
256-
name: gradlew :eclipse-wtp:changelogPush
257-
command: ./gradlew -Pcom.diffplug.spotless.include.ext.wtp=true :eclipse-wtp:changelogPush -Prelease=true --stacktrace
258143

259144
workflows:
260145
version: 2
@@ -274,105 +159,3 @@ workflows:
274159
- test_npm_8:
275160
requires:
276161
- assemble_testClasses
277-
deploy:
278-
jobs:
279-
- changelog_print:
280-
filters:
281-
branches:
282-
only: main
283-
- release_all:
284-
type: approval
285-
requires:
286-
- changelog_print
287-
- do_release_all:
288-
requires:
289-
- release_all
290-
context:
291-
- SonatypeDeploy
292-
- release_plugin_gradle:
293-
type: approval
294-
requires:
295-
- changelog_print
296-
- do_release_plugin_gradle:
297-
requires:
298-
- release_plugin_gradle
299-
context:
300-
- SonatypeDeploy
301-
- release_plugin_maven:
302-
type: approval
303-
requires:
304-
- changelog_print
305-
- do_release_plugin_maven:
306-
requires:
307-
- release_plugin_maven
308-
context:
309-
- SonatypeDeploy
310-
- release_lib:
311-
type: approval
312-
requires:
313-
- changelog_print
314-
- do_release_lib:
315-
requires:
316-
- release_lib
317-
context:
318-
- SonatypeDeploy
319-
ext_deploy:
320-
jobs:
321-
- ext_changelog_print:
322-
filters:
323-
branches:
324-
only: main
325-
- ext_release_base:
326-
type: approval
327-
requires:
328-
- ext_changelog_print
329-
- ext_do_release_base:
330-
requires:
331-
- ext_release_base
332-
context:
333-
- SonatypeDeploy
334-
- ext_release_jdt:
335-
type: approval
336-
requires:
337-
- ext_changelog_print
338-
- ext_do_release_jdt:
339-
requires:
340-
- ext_release_jdt
341-
context:
342-
- SonatypeDeploy
343-
- ext_release_cdt:
344-
type: approval
345-
requires:
346-
- ext_changelog_print
347-
- ext_do_release_cdt:
348-
filters:
349-
branches:
350-
only: main
351-
requires:
352-
- ext_release_cdt
353-
context:
354-
- SonatypeDeploy
355-
- ext_release_groovy:
356-
type: approval
357-
requires:
358-
- ext_changelog_print
359-
- ext_do_release_groovy:
360-
filters:
361-
branches:
362-
only: main
363-
requires:
364-
- ext_release_groovy
365-
context:
366-
- SonatypeDeploy
367-
- ext_release_wtp:
368-
type: approval
369-
requires:
370-
- ext_changelog_print
371-
- ext_do_release_wtp:
372-
filters:
373-
branches:
374-
only: main
375-
requires:
376-
- ext_release_wtp
377-
context:
378-
- SonatypeDeploy

.github/workflows/changelog-print.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: changelogPrint
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
name: changelogPrint
11+
steps:
12+
- uses: actions/checkout@v3
13+
- name: jdk 11
14+
uses: actions/setup-java@v3
15+
with:
16+
java-version: 11
17+
distribution: 'temurin'
18+
- name: gradle caching
19+
uses: gradle/gradle-build-action@v2
20+
- run: ./gradlew changelogPrint

.github/workflows/deploy.yml

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# GH_TOKEN
2+
# NEXUS_USER
3+
# NEXUS_PASS
4+
# GPG_PASSPHRASE
5+
# GPG_KEY (base64)
6+
# gpg --export-secret-keys --armor KEY_ID | openssl base64 | pbcopy
7+
# GRADLE_PORTAL_KEY
8+
# GRADLE_PORTAL_SECRET
9+
10+
name: deploy
11+
on:
12+
workflow_dispatch:
13+
inputs:
14+
to_publish:
15+
description: 'What to publish'
16+
required: true
17+
default: 'all'
18+
type: choice
19+
options:
20+
- plugin-gradle
21+
- plugin-maven
22+
- all
23+
- lib
24+
25+
jobs:
26+
build:
27+
runs-on: ubuntu-latest
28+
name: deploy
29+
env:
30+
gh_token: ${{ secrets.GH_TOKEN }}
31+
ORG_GRADLE_PROJECT_nexus_user: ${{ secrets.NEXUS_USER }}
32+
ORG_GRADLE_PROJECT_nexus_pass: ${{ secrets.NEXUS_PASS }}
33+
ORG_GRADLE_PROJECT_gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }}
34+
ORG_GRADLE_PROJECT_gpg_key64: ${{ secrets.GPG_KEY }}
35+
36+
gradle_key
37+
steps:
38+
- uses: actions/checkout@v3
39+
- name: jdk 11
40+
uses: actions/setup-java@v3
41+
with:
42+
java-version: 11
43+
distribution: 'temurin'
44+
- name: gradle caching
45+
uses: gradle/gradle-build-action@v2
46+
- name: publish all
47+
if: "${{ github.event.inputs.to_publish == 'all' }}"
48+
run: |
49+
./gradlew :changelogPush -Prelease=true --stacktrace --warning-mode all
50+
./gradlew :plugin-gradle:changelogPush -Prelease=true -Pgradle.publish.key=${{ secrets.GRADLE_PORTAL_KEY }} -Pgradle.publish.secret=${{ secrets.GRADLE_PORTAL_SECRET }} --stacktrace --warning-mode all
51+
./gradlew :plugin-maven:changelogPush -Prelease=true --stacktrace --warning-mode all
52+
- name: publish just plugin-gradle
53+
if: "${{ github.event.inputs.to_publish == 'plugin-gradle' }}"
54+
run: |
55+
./gradlew :plugin-gradle:changelogPush -Prelease=true -Pgradle.publish.key=${{ secrets.GRADLE_PORTAL_KEY }} -Pgradle.publish.secret=${{ secrets.GRADLE_PORTAL_SECRET }} --stacktrace --warning-mode all
56+
- name: publish just plugin-maven
57+
if: "${{ github.event.inputs.to_publish == 'plugin-maven' }}"
58+
run: |
59+
./gradlew :plugin-maven:changelogPush -Prelease=true --stacktrace --warning-mode all
60+
- name: publish just lib
61+
if: "${{ github.event.inputs.to_publish == 'lib' }}"
62+
run: |
63+
./gradlew :changelogPush -Prelease=true --stacktrace --warning-mode all

CHANGES.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,24 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
1111

1212
## [Unreleased]
1313
### Added
14+
* Add option `editorConfigFile` for `ktLint` [#142](https://github.com/diffplug/spotless/issues/142)
15+
* Added `skipLinesMatching` option to `licenseHeader` to support formats where license header cannot be immediately added to the top of the file (e.g. xml, sh). ([#1441](https://github.com/diffplug/spotless/pull/1441)).
16+
### Fixed
17+
* 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))
1418
* Added support for npm-based [ESLint](https://eslint.org/)-formatter for javascript and typescript ([#1453](https://github.com/diffplug/spotless/pull/1453))
19+
1520
### Changes
16-
* Bump default Version for `prettier` from `2.0.5` to `2.8.1`
21+
* Bump default version for `prettier` from `2.0.5` to `2.8.1` ([#1453](https://github.com/diffplug/spotless/pull/1453))
1722
* Bump the dev version of Gradle from `7.5.1` to `7.6` ([#1409](https://github.com/diffplug/spotless/pull/1409))
1823
* We also removed the no-longer-required dependency `org.codehaus.groovy:groovy-xml`
1924
* Breaking changes to Spotless' internal testing infrastructure `testlib` ([#1443](https://github.com/diffplug/spotless/pull/1443))
2025
* `ResourceHarness` no longer has any duplicated functionality which was also present in `StepHarness`
2126
* `StepHarness` now operates on `Formatter` rather than a `FormatterStep`
2227
* `StepHarnessWithFile` now takes a `ResourceHarness` in its constructor to handle the file manipulation parts
2328
* Standardized that we test exception *messages*, not types, which will ease the transition to linting later on
29+
* Bump default `ktlint` version to latest `0.47.1` -> `0.48.1` ([#1456](https://github.com/diffplug/spotless/pull/1456))
30+
* Switch our publishing infrastructure from CircleCI to GitHub Actions ([#1462](https://github.com/diffplug/spotless/pull/1462)).
31+
* Help wanted for moving our tests too ([#1472](https://github.com/diffplug/spotless/issues/1472))
2432

2533

2634
## [2.31.1] - 2023-01-02

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ VER_SLF4J=[1.6,2.0[
2727
VER_DURIAN=1.2.0
2828
VER_JGIT=5.13.1.202206130422-r
2929
VER_JUNIT=5.9.1
30-
VER_ASSERTJ=3.23.1
30+
VER_ASSERTJ=3.24.1
3131
VER_MOCKITO=4.11.0
3232

3333
# Used for Maven Plugin

lib/build.gradle

+9-7
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ dependencies {
4545
compileOnly 'org.slf4j:slf4j-api:2.0.0'
4646
// zero runtime reqs is a hard requirements for spotless-lib
4747
// if you need a dep, put it in lib-extra
48-
testImplementation "org.junit.jupiter:junit-jupiter:$VER_JUNIT"
49-
testImplementation "org.assertj:assertj-core:$VER_ASSERTJ"
50-
testImplementation "com.diffplug.durian:durian-testlib:$VER_DURIAN"
48+
testCommonImplementation "org.junit.jupiter:junit-jupiter:$VER_JUNIT"
49+
testCommonImplementation "org.assertj:assertj-core:$VER_ASSERTJ"
50+
testCommonImplementation "com.diffplug.durian:durian-testlib:$VER_DURIAN"
5151

5252
// used for pom sorting
5353
sortPomCompileOnly 'com.github.ekryd.sortpom:sortpom-sorter:3.0.0'
@@ -91,9 +91,9 @@ dependencies {
9191
compatKtLint0Dot47Dot0CompileOnly 'com.pinterest.ktlint:ktlint-core:0.47.0'
9292
compatKtLint0Dot47Dot0CompileOnly 'com.pinterest.ktlint:ktlint-ruleset-experimental:0.47.0'
9393
compatKtLint0Dot47Dot0CompileOnly 'com.pinterest.ktlint:ktlint-ruleset-standard:0.47.0'
94-
compatKtLint0Dot48Dot0CompileOnly 'com.pinterest.ktlint:ktlint-core:0.48.0'
95-
compatKtLint0Dot48Dot0CompileOnly 'com.pinterest.ktlint:ktlint-ruleset-experimental:0.48.0'
96-
compatKtLint0Dot48Dot0CompileOnly 'com.pinterest.ktlint:ktlint-ruleset-standard:0.48.0'
94+
compatKtLint0Dot48Dot0CompileAndTestOnly 'com.pinterest.ktlint:ktlint-core:0.48.0'
95+
compatKtLint0Dot48Dot0CompileAndTestOnly 'com.pinterest.ktlint:ktlint-ruleset-experimental:0.48.0'
96+
compatKtLint0Dot48Dot0CompileAndTestOnly 'com.pinterest.ktlint:ktlint-ruleset-standard:0.48.0'
9797

9898
String VER_SCALAFMT="3.6.1"
9999
scalafmtCompileOnly "org.scalameta:scalafmt-core_2.13:$VER_SCALAFMT"
@@ -108,7 +108,9 @@ dependencies {
108108
// we'll hold the core lib to a high standard
109109
spotbugs { reportLevel = 'low' } // low|medium|high (low = sensitive to even minor mistakes)
110110

111-
test { useJUnitPlatform() }
111+
tasks.withType(Test).configureEach {
112+
useJUnitPlatform()
113+
}
112114

113115
jar {
114116
for (glue in NEEDS_GLUE) {

0 commit comments

Comments
 (0)