Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: maven plugin should identify skip config key #1353

Merged
merged 2 commits into from Sep 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions plugin-maven/CHANGES.md
Expand Up @@ -3,6 +3,8 @@
We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (starting after version `1.27.0`).

## [Unreleased]
### Fixed
* `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))

## [2.27.0] - 2022-09-19
### Added
Expand Down
Expand Up @@ -91,6 +91,9 @@ public abstract class AbstractSpotlessMojo extends AbstractMojo {
@Parameter(defaultValue = "${mojoExecution.goal}", required = true, readonly = true)
private String goal;

@Parameter(defaultValue = "false")
private boolean skip;

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

Expand Down Expand Up @@ -200,6 +203,10 @@ public final void execute() throws MojoExecutionException {
}

private boolean shouldSkip() {
if (skip) {
return true;
}

switch (goal) {
case GOAL_CHECK:
return checkSkip;
Expand All @@ -208,6 +215,7 @@ private boolean shouldSkip() {
default:
break;
}

return false;
}

Expand Down