Skip to content

Commit

Permalink
Merge branch 'main' into UpgradeCleanThat_2.16
Browse files Browse the repository at this point in the history
  • Loading branch information
nedtwigg authored Jun 30, 2023
2 parents 615ca6c + c58c55d commit ccc545a
Show file tree
Hide file tree
Showing 12 changed files with 44 additions and 16 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
## [Unreleased]
### Changes
* Bump default `cleanthat` version to latest `2.13` -> `2.16`. ([#1725](https://github.com/diffplug/spotless/pull/1725))
### Fixed
* Update documented default `semanticSort` to `false`. ([#1728](https://github.com/diffplug/spotless/pull/1728))

## [2.39.0] - 2023-05-24
### Added
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ VER_SLF4J=[1.6,2.0[

# Used in multiple places
VER_DURIAN=1.2.0
VER_JGIT=6.5.0.202303070854-r
VER_JGIT=6.6.0.202305301015-r
VER_JUNIT=5.9.3
VER_ASSERTJ=3.24.2
VER_MOCKITO=5.3.1
10 changes: 10 additions & 0 deletions plugin-gradle/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (

## [Unreleased]

### Fixed
* Correctly support the syntax
```
spotless {
yaml {
jackson().yamlFeature("MINIMIZE_QUOTES", true)
}
}
```

## [6.19.0] - 2023-05-24
### Added
* Support Rome as a formatter for JavaScript and TypeScript code. Adds a new `rome` step to `javascript` and `typescript` formatter configurations. ([#1663](https://github.com/diffplug/spotless/pull/1663))
Expand Down
2 changes: 1 addition & 1 deletion plugin-gradle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ spotless {
removeUnusedImports()
// optional: you may switch for `google-java-format` as underlying engine to `cleanthat-javaparser-unnecessaryimport`
// which enables processing any language level source file with a JDK8+ Runtime
removeUnusedImports().engine('cleanthat-javaparser-unnecessaryimport')
removeUnusedImports('cleanthat-javaparser-unnecessaryimport')
```

### google-java-format
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import com.diffplug.spotless.json.JacksonConfig;
import com.diffplug.spotless.json.JacksonJsonStep;

public abstract class AJacksonGradleConfig {
public abstract class AJacksonGradleConfig<T extends AJacksonGradleConfig> {
protected final FormatExtension formatExtension;

protected JacksonConfig jacksonConfig;
Expand All @@ -35,17 +35,19 @@ public AJacksonGradleConfig(JacksonConfig jacksonConfig, FormatExtension formatE
this.jacksonConfig = jacksonConfig;
}

public AJacksonGradleConfig feature(String feature, boolean toggle) {
public T feature(String feature, boolean toggle) {
this.jacksonConfig.appendFeatureToToggle(Collections.singletonMap(feature, toggle));
formatExtension.replaceStep(createStep());
return this;
return self();
}

public AJacksonGradleConfig version(String version) {
public T version(String version) {
this.version = version;
formatExtension.replaceStep(createStep());
return this;
return self();
}

public abstract T self();

protected abstract FormatterStep createStep();
}
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ private FormatterStep createStep() {
}
}

public static class JacksonJsonGradleConfig extends AJacksonGradleConfig {
public static class JacksonJsonGradleConfig extends AJacksonGradleConfig<JacksonJsonGradleConfig> {
protected JacksonJsonConfig jacksonConfig;

public JacksonJsonGradleConfig(JacksonJsonConfig jacksonConfig, FormatExtension formatExtension) {
Expand All @@ -149,12 +149,17 @@ public JacksonJsonGradleConfig(FormatExtension formatExtension) {
/**
* Refers to com.fasterxml.jackson.core.JsonGenerator.Feature
*/
public AJacksonGradleConfig jsonFeature(String feature, boolean toggle) {
public JacksonJsonGradleConfig jsonFeature(String feature, boolean toggle) {
this.jacksonConfig.appendJsonFeatureToToggle(Collections.singletonMap(feature, toggle));
formatExtension.replaceStep(createStep());
return this;
}

@Override
public JacksonJsonGradleConfig self() {
return this;
}

// 'final' as it is called in the constructor
@Override
protected final FormatterStep createStep() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ protected void setupTask(SpotlessTask task) {
super.setupTask(task);
}

public AJacksonGradleConfig jackson() {
public JacksonYamlGradleConfig jackson() {
return new JacksonYamlGradleConfig(this);
}

public class JacksonYamlGradleConfig extends AJacksonGradleConfig {
public class JacksonYamlGradleConfig extends AJacksonGradleConfig<JacksonYamlGradleConfig> {
protected JacksonYamlConfig jacksonConfig;

public JacksonYamlGradleConfig(JacksonYamlConfig jacksonConfig, FormatExtension formatExtension) {
Expand All @@ -61,12 +61,17 @@ public JacksonYamlGradleConfig(FormatExtension formatExtension) {
/**
* Refers to com.fasterxml.jackson.dataformat.yaml.YAMLGenerator.Feature
*/
public AJacksonGradleConfig yamlFeature(String feature, boolean toggle) {
public JacksonYamlGradleConfig yamlFeature(String feature, boolean toggle) {
this.jacksonConfig.appendYamlFeatureToToggle(Collections.singletonMap(feature, toggle));
formatExtension.replaceStep(createStep());
return this;
}

@Override
public JacksonYamlGradleConfig self() {
return this;
}

// 'final' as it is called in the constructor
@Override
protected final FormatterStep createStep() {
Expand Down
4 changes: 4 additions & 0 deletions plugin-maven/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (starting after version `1.27.0`).

## [Unreleased]
### Added
* Support pass skip (`-Dspotless.skip=true`) from command-line. ([#1729](https://github.com/diffplug/spotless/pull/1729))
### Fixed
* Update documented default `semanticSort` to `false`. ([#1728](https://github.com/diffplug/spotless/pull/1728))

## [2.37.0] - 2023-05-24
### Added
Expand Down
2 changes: 1 addition & 1 deletion plugin-maven/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ any other maven phase (i.e. compile) then it can be configured as below;
<wildcardsLast>false</wildcardsLast> <!-- Optional, default false. Sort wildcard import after specific imports -->
<order>java|javax,org,com,com.diffplug,,\#com.diffplug,\#</order> <!-- or use <file>${project.basedir}/eclipse.importorder</file> -->
<!-- you can use an empty string for all the imports you didn't specify explicitly, '|' to join group without blank line, and '\#` prefix for static imports. -->
<semanticSort>false</semanticSort> <!-- Optional, default true. Sort by package, then class, then member (for static imports). Splitting is based on common conventions (packages are lower case, classes start with upper case). Use <treatAsPackage> and <treatAsClass> for exceptions. -->
<semanticSort>false</semanticSort> <!-- Optional, default false. Sort by package, then class, then member (for static imports). Splitting is based on common conventions (packages are lower case, classes start with upper case). Use <treatAsPackage> and <treatAsClass> for exceptions. -->
<treatAsPackage> <!-- Packages starting with upper case letters. -->
<package>com.example.MyPackage</package>
</treatAsPackage>
Expand Down
2 changes: 1 addition & 1 deletion plugin-maven/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import de.benediktritter.maven.plugin.development.task.GenerateMavenPluginDescri

plugins {
// https://www.benediktritter.de/maven-plugin-development/#release-history
id 'de.benediktritter.maven-plugin-development' version '0.4.1'
id 'de.benediktritter.maven-plugin-development' version '0.4.2'
}

apply from: rootProject.file('gradle/changelog.gradle')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public abstract class AbstractSpotlessMojo extends AbstractMojo {
@Parameter(defaultValue = "${mojoExecution.goal}", required = true, readonly = true)
private String goal;

@Parameter(defaultValue = "false")
@Parameter(property = "spotless.skip", defaultValue = "false")
private boolean skip;

@Parameter(property = "spotless.apply.skip", defaultValue = "false")
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ plugins {
// https://github.com/davidburstrom/version-compatibility-gradle-plugin/tags
id 'io.github.davidburstrom.version-compatibility' version '0.5.0' apply false
// https://plugins.gradle.org/plugin/com.gradle.enterprise
id 'com.gradle.enterprise' version '3.13.2'
id 'com.gradle.enterprise' version '3.13.3'
// https://github.com/equodev/equo-ide/blob/main/plugin-gradle/CHANGELOG.md
id 'dev.equo.ide' version '1.0.1' apply false
}
Expand Down

0 comments on commit ccc545a

Please sign in to comment.