Skip to content

Commit 50e0186

Browse files
authored
fix: maven plugin should identify skip config key (#1353 fixes #1227 and #491)
2 parents f4ee554 + 622f3a0 commit 50e0186

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

plugin-maven/CHANGES.md

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (starting after version `1.27.0`).
44

55
## [Unreleased]
6+
### Fixed
7+
* `skip` config key should work again now. ([#1353](https://github.com/diffplug/spotless/pull/1353) fixes [#1227](https://github.com/diffplug/spotless/issues/1227) and [#491](https://github.com/diffplug/spotless/issues/491))
68

79
## [2.27.0] - 2022-09-19
810
### Added

plugin-maven/src/main/java/com/diffplug/spotless/maven/AbstractSpotlessMojo.java

+8
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ public abstract class AbstractSpotlessMojo extends AbstractMojo {
9191
@Parameter(defaultValue = "${mojoExecution.goal}", required = true, readonly = true)
9292
private String goal;
9393

94+
@Parameter(defaultValue = "false")
95+
private boolean skip;
96+
9497
@Parameter(property = "spotless.apply.skip", defaultValue = "false")
9598
private boolean applySkip;
9699

@@ -200,6 +203,10 @@ public final void execute() throws MojoExecutionException {
200203
}
201204

202205
private boolean shouldSkip() {
206+
if (skip) {
207+
return true;
208+
}
209+
203210
switch (goal) {
204211
case GOAL_CHECK:
205212
return checkSkip;
@@ -208,6 +215,7 @@ private boolean shouldSkip() {
208215
default:
209216
break;
210217
}
218+
211219
return false;
212220
}
213221

0 commit comments

Comments
 (0)