Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/diffplug/spotless into feat…
Browse files Browse the repository at this point in the history
…ure/eslint-npm

# Conflicts:
#	CHANGES.md
#	plugin-gradle/CHANGES.md
#	plugin-maven/CHANGES.md
#	plugin-maven/README.md
  • Loading branch information
simschla committed Jan 9, 2023
2 parents 98c023b + 4ee53aa commit 9a0932e
Show file tree
Hide file tree
Showing 43 changed files with 814 additions and 486 deletions.
217 changes: 0 additions & 217 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,121 +140,6 @@ jobs:
path: lib-extra/build/test-results/test
- store_test_results:
path: plugin-gradle/build/test-results/test
changelog_print:
<< : *env_gradle
steps:
- checkout
- *restore_cache_wrapper
- *restore_cache_deps
- run:
name: gradlew changelogPrint
command: ./gradlew changelogPrint
do_release_all:
<< : *env_gradle
steps:
- checkout
- *restore_cache_wrapper
- *restore_cache_deps
- *set_git_origin_to_https
- run:
name: gradlew :changelogPush
command: ./gradlew :changelogPush -Prelease=true --stacktrace --warning-mode all
- run:
name: gradlew :plugin-gradle:changelogPush
command: ./gradlew :plugin-gradle:changelogPush -Prelease=true -Pgradle.publish.key=${gradle_key} -Pgradle.publish.secret=${gradle_secret} --stacktrace --warning-mode all
- run:
name: gradlew :plugin-maven:changelogPush
command: ./gradlew :plugin-maven:changelogPush -Prelease=true --stacktrace --warning-mode all
do_release_lib:
<< : *env_gradle
steps:
- checkout
- *restore_cache_wrapper
- *restore_cache_deps
- *set_git_origin_to_https
- run:
name: gradlew :changelogPush
command: ./gradlew :changelogPush -Prelease=true --stacktrace --warning-mode all
do_release_plugin_gradle:
<< : *env_gradle
steps:
- checkout
- *restore_cache_wrapper
- *restore_cache_deps
- *set_git_origin_to_https
- run:
name: gradlew :plugin-gradle:changelogPush
command: ./gradlew :plugin-gradle:changelogPush -Prelease=true -Pgradle.publish.key=${gradle_key} -Pgradle.publish.secret=${gradle_secret} --stacktrace
do_release_plugin_maven:
<< : *env_gradle
steps:
- checkout
- *restore_cache_wrapper
- *restore_cache_deps
- *set_git_origin_to_https
- run:
name: gradlew :plugin-maven:changelogPush
command: ./gradlew :plugin-maven:changelogPush -Prelease=true --stacktrace
ext_changelog_print:
<< : *env_gradle
steps:
- checkout
- *restore_cache_wrapper
- *restore_cache_deps
- *set_git_origin_to_https
- run:
name: gradlew -Pcom.diffplug.spotless.include.ext.nop2=true changelogPrint
command: ./gradlew -Pcom.diffplug.spotless.include.ext.nop2=true changelogPrint
ext_do_release_base:
<< : *env_gradle
steps:
- checkout
- *restore_cache_wrapper
- *restore_cache_deps
- *set_git_origin_to_https
- run:
name: gradlew :eclipse-base:changelogPush
command: ./gradlew -Pcom.diffplug.spotless.include.ext.nop2=true :eclipse-base:changelogPush -Prelease=true --stacktrace
ext_do_release_jdt:
<< : *env_gradle
steps:
- checkout
- *restore_cache_wrapper
- *restore_cache_deps
- *set_git_origin_to_https
- run:
name: gradlew :eclipse-jdt:changelogPush
command: ./gradlew -Pcom.diffplug.spotless.include.ext.nop2=true :eclipse-jdt:changelogPush -Prelease=true --stacktrace
ext_do_release_cdt:
<< : *env_gradle
steps:
- checkout
- *restore_cache_wrapper
- *restore_cache_deps
- *set_git_origin_to_https
- run:
name: gradlew :eclipse-cdt:changelogPush
command: ./gradlew -Pcom.diffplug.spotless.include.ext.cdt=true :eclipse-cdt:changelogPush -Prelease=true --stacktrace
ext_do_release_groovy:
<< : *env_gradle
steps:
- checkout
- *restore_cache_wrapper
- *restore_cache_deps
- *set_git_origin_to_https
- run:
name: gradlew :eclipse-groovy:changelogPush
command: ./gradlew -Pcom.diffplug.spotless.include.ext.groovy=true :eclipse-groovy:changelogPush -Prelease=true --stacktrace
ext_do_release_wtp:
<< : *env_gradle
steps:
- checkout
- *restore_cache_wrapper
- *restore_cache_deps
- *set_git_origin_to_https
- run:
name: gradlew :eclipse-wtp:changelogPush
command: ./gradlew -Pcom.diffplug.spotless.include.ext.wtp=true :eclipse-wtp:changelogPush -Prelease=true --stacktrace

workflows:
version: 2
Expand All @@ -274,105 +159,3 @@ workflows:
- test_npm_8:
requires:
- assemble_testClasses
deploy:
jobs:
- changelog_print:
filters:
branches:
only: main
- release_all:
type: approval
requires:
- changelog_print
- do_release_all:
requires:
- release_all
context:
- SonatypeDeploy
- release_plugin_gradle:
type: approval
requires:
- changelog_print
- do_release_plugin_gradle:
requires:
- release_plugin_gradle
context:
- SonatypeDeploy
- release_plugin_maven:
type: approval
requires:
- changelog_print
- do_release_plugin_maven:
requires:
- release_plugin_maven
context:
- SonatypeDeploy
- release_lib:
type: approval
requires:
- changelog_print
- do_release_lib:
requires:
- release_lib
context:
- SonatypeDeploy
ext_deploy:
jobs:
- ext_changelog_print:
filters:
branches:
only: main
- ext_release_base:
type: approval
requires:
- ext_changelog_print
- ext_do_release_base:
requires:
- ext_release_base
context:
- SonatypeDeploy
- ext_release_jdt:
type: approval
requires:
- ext_changelog_print
- ext_do_release_jdt:
requires:
- ext_release_jdt
context:
- SonatypeDeploy
- ext_release_cdt:
type: approval
requires:
- ext_changelog_print
- ext_do_release_cdt:
filters:
branches:
only: main
requires:
- ext_release_cdt
context:
- SonatypeDeploy
- ext_release_groovy:
type: approval
requires:
- ext_changelog_print
- ext_do_release_groovy:
filters:
branches:
only: main
requires:
- ext_release_groovy
context:
- SonatypeDeploy
- ext_release_wtp:
type: approval
requires:
- ext_changelog_print
- ext_do_release_wtp:
filters:
branches:
only: main
requires:
- ext_release_wtp
context:
- SonatypeDeploy
20 changes: 20 additions & 0 deletions .github/workflows/changelog-print.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: changelogPrint

on:
push:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest
name: changelogPrint
steps:
- uses: actions/checkout@v3
- name: jdk 11
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'temurin'
- name: gradle caching
uses: gradle/gradle-build-action@v2
- run: ./gradlew changelogPrint
63 changes: 63 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# GH_TOKEN
# NEXUS_USER
# NEXUS_PASS
# GPG_PASSPHRASE
# GPG_KEY (base64)
# gpg --export-secret-keys --armor KEY_ID | openssl base64 | pbcopy
# GRADLE_PORTAL_KEY
# GRADLE_PORTAL_SECRET

name: deploy
on:
workflow_dispatch:
inputs:
to_publish:
description: 'What to publish'
required: true
default: 'all'
type: choice
options:
- plugin-gradle
- plugin-maven
- all
- lib

jobs:
build:
runs-on: ubuntu-latest
name: deploy
env:
gh_token: ${{ secrets.GH_TOKEN }}
ORG_GRADLE_PROJECT_nexus_user: ${{ secrets.NEXUS_USER }}
ORG_GRADLE_PROJECT_nexus_pass: ${{ secrets.NEXUS_PASS }}
ORG_GRADLE_PROJECT_gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }}
ORG_GRADLE_PROJECT_gpg_key64: ${{ secrets.GPG_KEY }}

gradle_key
steps:
- uses: actions/checkout@v3
- name: jdk 11
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'temurin'
- name: gradle caching
uses: gradle/gradle-build-action@v2
- name: publish all
if: "${{ github.event.inputs.to_publish == 'all' }}"
run: |
./gradlew :changelogPush -Prelease=true --stacktrace --warning-mode all
./gradlew :plugin-gradle:changelogPush -Prelease=true -Pgradle.publish.key=${{ secrets.GRADLE_PORTAL_KEY }} -Pgradle.publish.secret=${{ secrets.GRADLE_PORTAL_SECRET }} --stacktrace --warning-mode all
./gradlew :plugin-maven:changelogPush -Prelease=true --stacktrace --warning-mode all
- name: publish just plugin-gradle
if: "${{ github.event.inputs.to_publish == 'plugin-gradle' }}"
run: |
./gradlew :plugin-gradle:changelogPush -Prelease=true -Pgradle.publish.key=${{ secrets.GRADLE_PORTAL_KEY }} -Pgradle.publish.secret=${{ secrets.GRADLE_PORTAL_SECRET }} --stacktrace --warning-mode all
- name: publish just plugin-maven
if: "${{ github.event.inputs.to_publish == 'plugin-maven' }}"
run: |
./gradlew :plugin-maven:changelogPush -Prelease=true --stacktrace --warning-mode all
- name: publish just lib
if: "${{ github.event.inputs.to_publish == 'lib' }}"
run: |
./gradlew :changelogPush -Prelease=true --stacktrace --warning-mode all
10 changes: 9 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,24 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (

## [Unreleased]
### Added
* Add option `editorConfigFile` for `ktLint` [#142](https://github.com/diffplug/spotless/issues/142)
* 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)).
### Fixed
* 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))
* Added support for npm-based [ESLint](https://eslint.org/)-formatter for javascript and typescript ([#1453](https://github.com/diffplug/spotless/pull/1453))

### Changes
* Bump default Version for `prettier` from `2.0.5` to `2.8.1`
* Bump default version for `prettier` from `2.0.5` to `2.8.1` ([#1453](https://github.com/diffplug/spotless/pull/1453))
* Bump the dev version of Gradle from `7.5.1` to `7.6` ([#1409](https://github.com/diffplug/spotless/pull/1409))
* We also removed the no-longer-required dependency `org.codehaus.groovy:groovy-xml`
* Breaking changes to Spotless' internal testing infrastructure `testlib` ([#1443](https://github.com/diffplug/spotless/pull/1443))
* `ResourceHarness` no longer has any duplicated functionality which was also present in `StepHarness`
* `StepHarness` now operates on `Formatter` rather than a `FormatterStep`
* `StepHarnessWithFile` now takes a `ResourceHarness` in its constructor to handle the file manipulation parts
* Standardized that we test exception *messages*, not types, which will ease the transition to linting later on
* Bump default `ktlint` version to latest `0.47.1` -> `0.48.1` ([#1456](https://github.com/diffplug/spotless/pull/1456))
* Switch our publishing infrastructure from CircleCI to GitHub Actions ([#1462](https://github.com/diffplug/spotless/pull/1462)).
* Help wanted for moving our tests too ([#1472](https://github.com/diffplug/spotless/issues/1472))


## [2.31.1] - 2023-01-02
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ VER_SLF4J=[1.6,2.0[
VER_DURIAN=1.2.0
VER_JGIT=5.13.1.202206130422-r
VER_JUNIT=5.9.1
VER_ASSERTJ=3.23.1
VER_ASSERTJ=3.24.1
VER_MOCKITO=4.11.0

# Used for Maven Plugin
Expand Down
16 changes: 9 additions & 7 deletions lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ dependencies {
compileOnly 'org.slf4j:slf4j-api:2.0.0'
// zero runtime reqs is a hard requirements for spotless-lib
// if you need a dep, put it in lib-extra
testImplementation "org.junit.jupiter:junit-jupiter:$VER_JUNIT"
testImplementation "org.assertj:assertj-core:$VER_ASSERTJ"
testImplementation "com.diffplug.durian:durian-testlib:$VER_DURIAN"
testCommonImplementation "org.junit.jupiter:junit-jupiter:$VER_JUNIT"
testCommonImplementation "org.assertj:assertj-core:$VER_ASSERTJ"
testCommonImplementation "com.diffplug.durian:durian-testlib:$VER_DURIAN"

// used for pom sorting
sortPomCompileOnly 'com.github.ekryd.sortpom:sortpom-sorter:3.0.0'
Expand Down Expand Up @@ -91,9 +91,9 @@ dependencies {
compatKtLint0Dot47Dot0CompileOnly 'com.pinterest.ktlint:ktlint-core:0.47.0'
compatKtLint0Dot47Dot0CompileOnly 'com.pinterest.ktlint:ktlint-ruleset-experimental:0.47.0'
compatKtLint0Dot47Dot0CompileOnly 'com.pinterest.ktlint:ktlint-ruleset-standard:0.47.0'
compatKtLint0Dot48Dot0CompileOnly 'com.pinterest.ktlint:ktlint-core:0.48.0'
compatKtLint0Dot48Dot0CompileOnly 'com.pinterest.ktlint:ktlint-ruleset-experimental:0.48.0'
compatKtLint0Dot48Dot0CompileOnly 'com.pinterest.ktlint:ktlint-ruleset-standard:0.48.0'
compatKtLint0Dot48Dot0CompileAndTestOnly 'com.pinterest.ktlint:ktlint-core:0.48.0'
compatKtLint0Dot48Dot0CompileAndTestOnly 'com.pinterest.ktlint:ktlint-ruleset-experimental:0.48.0'
compatKtLint0Dot48Dot0CompileAndTestOnly 'com.pinterest.ktlint:ktlint-ruleset-standard:0.48.0'

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

test { useJUnitPlatform() }
tasks.withType(Test).configureEach {
useJUnitPlatform()
}

jar {
for (glue in NEEDS_GLUE) {
Expand Down
Loading

0 comments on commit 9a0932e

Please sign in to comment.