Skip to content

Commit

Permalink
Update spotless to 7.0.0.beta4 (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
jskov authored Nov 17, 2024
1 parent 130e3a9 commit 0124b2a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ By default uses [this configuration](./src/main/resources/config/spotless/eclips
* `dk.mada.style.formatter.eclipse-config-path = null`
Optional path to an alternative eclipse formatter configuration file
This can be a URL; the content will be downloaded and cached (so if you want to update the content, you must change the URL)
* `dk.mada.style.formatter.eclipse-429-p2-url = null`
Optional URL to a P2 update repository containing Eclipse 4.29 (aka 2023.09) plugins.
* `dk.mada.style.formatter.eclipse-432-p2-url = null`
Optional URL to a P2 update repository containing Eclipse 4.32 (aka 2024.06) plugins.

**Null-checker**

Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ nullaway = { module = "com.uber.nullaway:nullaway", version = "0.12.1

sonarPlugin = { module = "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin", version = "5.1.0.4882" }

spotlessPlugin = { module = "com.diffplug.spotless:spotless-plugin-gradle", version = "6.25.0" }
spotlessPlugin = { module = "com.diffplug.spotless:spotless-plugin-gradle", version = "7.0.0.BETA4" }

6 changes: 3 additions & 3 deletions src/main/java/dk/mada/style/config/PluginConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ public record ErrorProneConfiguration(boolean enabled, boolean ignoreTestSource,
* @param includes Ant-style patterns for sources to format
* @param excludes Ant-style patterns for sources to ignore
* @param eclipseConfigPath an optional path to an eclipse configuration file
* @param eclipse429P2mirror an optional URL to a eclipse update P2 repository
* @param eclipse432P2mirror an optional URL to a eclipse update P2 repository
*/
public record FormatterConfiguration(boolean enabled, List<String> includes, List<String> excludes, @Nullable String eclipseConfigPath,
@Nullable String eclipse429P2mirror) {
@Nullable String eclipse432P2mirror) {
}

/**
Expand Down Expand Up @@ -129,7 +129,7 @@ public PluginConfiguration(Project project) {
getListProperty("formatter.include", List.of("src/main/java/**/*.java", "src/test/java/**/*.java")),
getListProperty("formatter.exclude", List.of()),
getNullableProperty("formatter.eclipse-config-path", null),
getNullableProperty("formatter.eclipse-429-p2-url", null));
getNullableProperty("formatter.eclipse-432-p2-url", null));

nullcheckerConf = new NullcheckerConfiguration(
getBoolProperty("null-checker.enabled", true),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ private void configureJava(JavaExtension je) {
EclipseConfig eclipseConfig = je.eclipse();
eclipseConfig.configFile(configFile);

String p2Mirror = formatterConfig.eclipse429P2mirror();
String p2Mirror = formatterConfig.eclipse432P2mirror();
if (p2Mirror != null) {
eclipseConfig.withP2Mirrors(Map.of("https://download.eclipse.org/eclipse/updates/4.29/", p2Mirror));
eclipseConfig.withP2Mirrors(Map.of("https://download.eclipse.org/eclipse/updates/4.32/", p2Mirror));
}

je.formatAnnotations(); // Note that this *must* come after the java formatter configuration
Expand Down

0 comments on commit 0124b2a

Please sign in to comment.