Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/changelog-print.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ jobs:
with:
java-version: 21
distribution: 'temurin'
- name: gradle caching
- name: Setup Gradle 🐘
uses: gradle/actions/setup-gradle@v5
- run: ./gradlew changelogPrint
72 changes: 35 additions & 37 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:
push:
branches: [main, release]
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand All @@ -19,34 +18,35 @@ jobs:
buildcacheuser: ${{ secrets.BUILDCACHE_USER }}
buildcachepass: ${{ secrets.BUILDCACHE_PASS }}
steps:
- name: Checkout
- name: Checkout Code 📥
uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-java@v5
with:
distribution: "temurin"
distribution: temurin
java-version: 21
- name: gradle caching
- name: Setup Gradle 🐘
uses: gradle/actions/setup-gradle@v5
- name: Spotless ✨
run: ./gradlew spotlessCheck
run: ./gradlew clean spotlessCheck
- name: Error Prone 🚧
run: ./gradlew clean assemble
- name: Test Classes ⚙️
run: ./gradlew clean testClasses
- name: Rewrite ♻️
run: ./gradlew rewriteDryRun
- name: assemble testClasses
run: ./gradlew assemble testClasses
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is came into live as one job:

Image

as its one dedicated goal why not run it also in dedicated job?

Image

run: ./gradlew clean rewriteDryRun
Copy link
Contributor Author

@Pankraz76 Pankraz76 Jan 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try with clean to avoid regression like seen in: @Goooler

build:
name: Build 🏗️
needs: sanity-check
strategy:
fail-fast: false
matrix:
kind: [maven, gradle]
# Test on the latest Java version once Gradle & Maven support it.
jre: [17, 21, 24]
jre: [17, 21, 24] # test on the latest Java version once Gradle & Maven support it.
os: [ubuntu-latest, windows-latest]
include:
# npm on linux only (crazy slow on windows)
- kind: npm
- kind: npm # npm on linux only (crazy slow on windows).
jre: 17
os: ubuntu-latest
- kind: shfmt
Expand All @@ -58,66 +58,64 @@ jobs:
os: ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
- name: Checkout Code 📥
uses: actions/checkout@v6
- uses: actions/setup-java@v5
with:
distribution: "temurin"
distribution: temurin
java-version: ${{ matrix.jre }}
- name: gradle caching
- name: Setup Gradle 🐘
uses: gradle/actions/setup-gradle@v5
- name: build (maven-only)
- name: Build Maven 🪶
if: matrix.kind == 'maven'
run: ./gradlew :plugin-maven:build -x spotlessCheck -x rewriteDryRun
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • rewriteDryRun
    • we only call this on demand.
  • spotlessCheck
    • we do not reach here if not complain, could double check here or is this flaky as well, therefore excluded ?

- name: build (everything-but-maven)
run: ./gradlew :plugin-maven:build -x spotlessCheck
- name: Build Gradle 🐘
if: matrix.kind == 'gradle'
run: ./gradlew build -x spotlessCheck -x rewriteDryRun -PSPOTLESS_EXCLUDE_MAVEN=true
- name: test npm
run: ./gradlew build -PSPOTLESS_EXCLUDE_MAVEN=true -x spotlessCheck
- name: Test npm 📊
if: matrix.kind == 'npm'
run: ./gradlew testNpm
- name: Setup go
- name: Setup Go
if: matrix.kind == 'shfmt'
uses: actions/setup-go@v6
with:
go-version: 'stable'
- name: Install shfmt
go-version: stable
- name: Install shfmt 📥
if: matrix.kind == 'shfmt'
run: |
go install mvdan.cc/sh/v3/cmd/shfmt@${{ matrix.shfmt-version }}
- name: Test shfmt
run: go install mvdan.cc/sh/v3/cmd/shfmt@${{ matrix.shfmt-version }}
- name: Test shfmt 📊
if: matrix.kind == 'shfmt'
run: ./gradlew testShfmt
- name: Test idea
- name: Test IDEA 📊
if: matrix.kind == 'idea'
run: |
download_link=$(curl https://data.services.jetbrains.com/products/releases\?code\=IIC\&latest\=true\&type\=release | jq -r '.IIC[0].downloads.linux.link')
curl --location "$download_link" -o idea.tar.gz
curl --location $download_link -o idea.tar.gz
tar -xf idea.tar.gz
cd idea-IC*
export PATH=${PATH}:$(pwd)/bin
cd ..
./gradlew testIdea
- name: junit result
- name: Junit Report 📋
uses: mikepenz/action-junit-report@v6
if: always() # always run even if the previous step fails
if: always() # always run even if the previous step fails.
with:
check_name: JUnit ${{ matrix.kind }} ${{ matrix.jre }} ${{ matrix.os }}
report_paths: '*/build/test-results/*/TEST-*.xml'
check_retries: true

# Status check that is required in branch protection rules.
final-status:
complete: # this check is required in branch protection rules.
name: Complete ✅
needs:
- sanity-check
- build
runs-on: ubuntu-latest
if: always()
steps:
- name: Check
- name: Check 🦉
run: |
results=$(tr -d '\n' <<< '${{ toJSON(needs.*.result) }}')
if ! grep -q -v -E '(failure|cancelled)' <<< "$results"; then
echo "One or more required jobs failed"
if ! grep -q -v -E '(failure|cancelled)' <<< $results; then
echo One or more required jobs failed.
exit 1
fi
echo "All required jobs completed successfully."
echo All required jobs completed successfully.
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection

steps:
- name: Checkout repository
- name: Checkout Code 📥
uses: actions/checkout@v6
with:
# We must fetch at least the immediate parents so that if this is
Expand All @@ -54,7 +54,7 @@ jobs:
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
with:
java-version: 21
distribution: 'temurin'
- name: gradle caching
- name: Setup Gradle 🐘
uses: gradle/actions/setup-gradle@v5
- name: git fetch origin main
run: git fetch origin main
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Spotless can format &lt;antlr | c | c# | c++ | css | flow | graphql | groovy | h

You probably want one of the links below:

## [️ 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))
## [️ 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))

```console
user@machine repo % ./gradlew build
Expand All @@ -25,7 +25,7 @@ user@machine repo % ./gradlew build
BUILD SUCCESSFUL
```

## [️ Spotless for Maven](plugin-maven)
## [️ Spotless for Maven](plugin-maven)

```console
user@machine repo % mvn spotless:check
Expand All @@ -40,7 +40,7 @@ user@machine repo % mvn spotless:check
[INFO] BUILD SUCCESS
```

## [️ Spotless for SBT (external for now)](https://github.com/moznion/sbt-spotless)
## [️ Spotless for SBT (external for now)](https://github.com/moznion/sbt-spotless)
## [Other build systems](CONTRIBUTING.md#how-to-add-a-new-plugin-for-a-build-system)

## How it works (for potential contributors)
Expand Down
20 changes: 19 additions & 1 deletion rewrite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,18 @@ recipeList:
- org.openrewrite.gradle.EnableGradleBuildCache
- org.openrewrite.gradle.EnableGradleParallelExecution
- org.openrewrite.gradle.GradleBestPractices
- org.openrewrite.hcl.format.RemoveTrailingWhitespace
- org.openrewrite.java.RemoveUnusedImports
- org.openrewrite.java.ShortenFullyQualifiedTypeReferences
- org.openrewrite.java.SimplifySingleElementAnnotation
- org.openrewrite.java.format.EmptyNewlineAtEndOfFile
- org.openrewrite.java.format.NormalizeFormat
- org.openrewrite.java.format.NormalizeLineBreaks
- org.openrewrite.java.format.PadEmptyForLoopComponents
- org.openrewrite.java.format.RemoveTrailingWhitespace
- org.openrewrite.java.migrate.UpgradeToJava17
- org.openrewrite.java.migrate.lang.JavaLangAPIs
- org.openrewrite.java.migrate.lang.StringRulesRecipes
- org.openrewrite.java.migrate.util.JavaLangAPIs
- org.openrewrite.java.migrate.util.JavaUtilAPIs
- org.openrewrite.java.migrate.util.MigrateInflaterDeflaterToClose
- org.openrewrite.java.migrate.util.ReplaceStreamCollectWithToList
Expand All @@ -22,19 +27,32 @@ recipeList:
- org.openrewrite.java.recipes.RecipeTestingBestPractices
- org.openrewrite.java.security.JavaSecurityBestPractices
- org.openrewrite.staticanalysis.BufferedWriterCreationRecipes
- org.openrewrite.staticanalysis.ChainStringBuilderAppendCalls
- org.openrewrite.staticanalysis.CommonStaticAnalysis
- org.openrewrite.staticanalysis.CustomImportOrder
- org.openrewrite.staticanalysis.DefaultComesLast
- org.openrewrite.staticanalysis.EmptyBlock
- org.openrewrite.staticanalysis.EqualsAvoidsNull
- org.openrewrite.staticanalysis.ExplicitInitialization
- org.openrewrite.staticanalysis.FallThrough
- org.openrewrite.staticanalysis.FinalizePrivateFields
- org.openrewrite.staticanalysis.ForLoopControlVariablePostfixOperators
- org.openrewrite.staticanalysis.HideUtilityClassConstructor
- org.openrewrite.staticanalysis.JavaApiBestPractices
- org.openrewrite.staticanalysis.LowercasePackage
- org.openrewrite.staticanalysis.MissingOverrideAnnotation
- org.openrewrite.staticanalysis.ModifierOrder
- org.openrewrite.staticanalysis.NeedBraces
- org.openrewrite.staticanalysis.NoFinalizer
- org.openrewrite.staticanalysis.NoToStringOnStringType
- org.openrewrite.staticanalysis.NoValueOfOnStringType
- org.openrewrite.staticanalysis.RemoveUnusedLocalVariables
- org.openrewrite.staticanalysis.RemoveUnusedPrivateFields
- org.openrewrite.staticanalysis.RemoveUnusedPrivateMethods
- org.openrewrite.staticanalysis.ReplaceStringBuilderWithString
- org.openrewrite.staticanalysis.ReplaceThreadRunWithThreadStart
- org.openrewrite.staticanalysis.SimplifyTernaryRecipes
- org.openrewrite.staticanalysis.TypecastParenPad
- org.openrewrite.staticanalysis.URLEqualsHashCodeRecipes
- org.openrewrite.staticanalysis.UnnecessaryCloseInTryWithResources
- org.openrewrite.staticanalysis.UnnecessaryExplicitTypeArguments
Expand Down
53 changes: 0 additions & 53 deletions testlib/src/main/java/com/diffplug/spotless/ReflectionUtil.java

This file was deleted.

Loading
Loading