Skip to content

Commit 11bfe31

Browse files
author
Vincent Potucek
committed
Merge branch 'main' into activate-removeWildcardImports
2 parents a14663d + a8b5172 commit 11bfe31

File tree

64 files changed

+1619
-328
lines changed

Some content is hidden

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

64 files changed

+1619
-328
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ jobs:
5959
jre: 11
6060
os: ubuntu-latest
6161
shfmt-version: v3.8.0
62+
- kind: idea
63+
jre: 11
64+
os: ubuntu-latest
6265
runs-on: ${{ matrix.os }}
6366
steps:
6467
- name: Checkout
@@ -91,6 +94,16 @@ jobs:
9194
- name: Test shfmt
9295
if: matrix.kind == 'shfmt'
9396
run: ./gradlew testShfmt
97+
- name: Test idea
98+
if: matrix.kind == 'idea'
99+
run: |
100+
download_link=$(curl https://data.services.jetbrains.com/products/releases\?code\=IIC\&latest\=true\&type\=release | jq -r '.IIC[0].downloads.linux.link')
101+
curl --location "$download_link" -o idea.tar.gz
102+
tar -xf idea.tar.gz
103+
cd idea-IC*
104+
export PATH=${PATH}:$(pwd)/bin
105+
cd ..
106+
./gradlew testIdea
94107
- name: junit result
95108
uses: mikepenz/action-junit-report@v5
96109
if: always() # always run even if the previous step fails

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
# Project-specific stuff
88
userHome/
99
workspace/
10+
testenv.properties
1011

1112
### Gradle ###
1213
.gradle

.idea/vcs.xml

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CHANGES.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,18 @@ 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+
## [3.2.0] - 2025-07-07
1315
### Added
16+
* Support for `idea` ([#2020](https://github.com/diffplug/spotless/pull/2020), [#2535](https://github.com/diffplug/spotless/pull/2535))
1417
* Add support for removing wildcard imports via `removeWildcardImports` step. ([#2517](https://github.com/diffplug/spotless/pull/2517))
18+
* scalafmt: enforce version consistency between the version configured in Spotless and the version declared in Scalafmt config file ([#2460](https://github.com/diffplug/spotless/issues/2460))
19+
### Fixed
20+
* `SortPom` disable expandEmptyElements, to avoid empty body warnings. ([#2520](https://github.com/diffplug/spotless/pull/2520))
21+
* Fix biome formatter for new major release 2.x of biome ([#2537](https://github.com/diffplug/spotless/pull/2537))
22+
* Make sure npm-based formatters use the correct `node_modules` directory when running in parallel. ([#2542](https://github.com/diffplug/spotless/pull/2542))
23+
### Changed
24+
* Bump internal dependencies for npm-based formatters ([#2542](https://github.com/diffplug/spotless/pull/2542))
1525

1626
## [3.1.2] - 2025-05-27
1727
### Fixed
@@ -409,8 +419,6 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
409419
## [2.26.0] - 2022-06-05
410420
### Added
411421
* Support for `editorConfigOverride` in `ktlint`. ([#1218](https://github.com/diffplug/spotless/pull/1218) fixes [#1193](https://github.com/diffplug/spotless/issues/1193))
412-
### Fixed
413-
* `google-java-format` and `RemoveUnusedImportsStep` works on JDK16+ without jvm args workaround. ([#1224](https://github.com/diffplug/spotless/pull/1224) fixes [#834](https://github.com/diffplug/spotless/issues/834))
414422

415423
## [2.25.3] - 2022-05-10
416424
### Fixed

INTELLIJ_IDEA_SCREENSHOTS.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Extracting Code Style from IntelliJ IDEA
2+
3+
## 1. Exporting Code Style Settings to a file
4+
To export code style settings from IntelliJ IDEA to a file, go to
5+
`Settings | Editor | Code Style` and click on the gear icon next to the scheme name.
6+
7+
![Exporting code style settings](_images/intellij_export_codestyle.png)
8+
9+
## 2. Using IntelliJ's active code style directly
10+
If you have your code style settings checked into version control (in your `.idea` directory),
11+
you can use the active code style directly in Spotless without exporting it to a file.
12+
The file can be found at `.idea/codeStyles/Project.xml`.
13+
14+
## Upstream documentation
15+
More details can be found in the [IntelliJ IDEA documentation](https://www.jetbrains.com/help/idea/command-line-formatter.html#options)
16+
for the command line formatter, which is what Spotless uses under the hood.

_images/intellij_export_codestyle.png

131 KB
Loading

gradle/java-publish.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ if (project.parent == null) {
2020
nexusPublishing {
2121
repositories {
2222
sonatype {
23-
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
24-
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
23+
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
24+
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
2525
username = System.env['ORG_GRADLE_PROJECT_nexus_user']
2626
password = decode64('ORG_GRADLE_PROJECT_nexus_pass64')
2727
}

gradle/special-tests.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ def special = [
66
'buf',
77
'clang',
88
'gofmt',
9+
'idea',
910
'npm',
1011
'shfmt'
1112
]
@@ -37,5 +38,9 @@ tasks.named('test').configure {
3738
special.forEach { tag ->
3839
tasks.register("test${tag.capitalize()}", Test) {
3940
useJUnitPlatform { includeTags tag }
41+
if (rootProject.file('testenv.properties').exists()) {
42+
systemProperty 'testenv.properties.path', rootProject.file('testenv.properties').canonicalPath
43+
}
4044
}
4145
}
46+

lib/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ dependencies {
7676
testCommonImplementation "org.junit.jupiter:junit-jupiter:$VER_JUNIT"
7777
testCommonImplementation "org.assertj:assertj-core:$VER_ASSERTJ"
7878
testCommonImplementation "com.diffplug.durian:durian-testlib:$VER_DURIAN"
79+
testCommonImplementation projects.testlib
7980
testCommonRuntimeOnly "org.junit.platform:junit-platform-launcher"
8081

8182
// GLUE CODE (alphabetic order please)

lib/src/main/java/com/diffplug/spotless/biome/BiomeExecutableDownloader.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2024 DiffPlug
2+
* Copyright 2016-2025 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.
@@ -71,17 +71,13 @@ final class BiomeExecutableDownloader {
7171

7272
private final Path downloadDir;
7373

74-
private final BiomeFlavor flavor;
75-
7674
/**
7775
* Creates a new downloader for the Biome executable. The executable files are
7876
* stored in the given download directory.
7977
*
80-
* @param flavor Flavor of Biome to use.
8178
* @param downloadDir Directory where to store the downloaded executable.
8279
*/
83-
public BiomeExecutableDownloader(BiomeFlavor flavor, Path downloadDir) {
84-
this.flavor = flavor;
80+
public BiomeExecutableDownloader(Path downloadDir) {
8581
this.downloadDir = downloadDir;
8682
}
8783

@@ -240,7 +236,7 @@ private String computeChecksum(Path file, String algorithm) throws IOException {
240236
* Finds the code name for the given operating system used by the Biome
241237
* executable download URL.
242238
*
243-
* @param os Desired operating system.
239+
* @param architecture Desired operating system architecture.
244240
* @return Code name for the Biome download URL.
245241
* @throws IOException When the given OS is not supported by Biome.
246242
*/
@@ -282,7 +278,7 @@ private String getDownloadUrl(String version, Platform platform) throws IOExcept
282278
var architectureCodeName = getArchitectureCodeName(platform.getArchitecture());
283279
var extension = getDownloadUrlExtension(platform.getOs());
284280
var platformString = String.format(PLATFORM_PATTERN, osCodeName, architectureCodeName, extension);
285-
return String.format(flavor.getUrlPattern(), version, platformString);
281+
return String.format(BiomeSettings.getUrlPattern(version), version, platformString);
286282
}
287283

288284
/**
@@ -317,7 +313,7 @@ private String getDownloadUrlExtension(OS os) throws IOException {
317313
private Path getExecutablePath(String version, Platform platform) {
318314
var os = platform.getOs().name().toLowerCase(Locale.ROOT);
319315
var arch = platform.getArchitecture().name().toLowerCase(Locale.ROOT);
320-
var fileName = String.format(flavor.getDownloadFilePattern(), os, arch, version);
316+
var fileName = String.format(BiomeSettings.getDownloadFilePattern(), os, arch, version);
321317
return downloadDir.resolve(fileName);
322318
}
323319

0 commit comments

Comments
 (0)