Document and localize Maven skip properties - #3009
Conversation
Move spotless.check.skip and spotless.apply.skip onto their respective mojos, keep spotless.skip on the shared base, and document all three properties in the Maven plugin README so check.skip is no longer mistaken for a global switch. Fixes diffplug#2981
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 513a3827d7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| - set `spotless.check.skip` to `true` in the `<properties>` section of the `pom.xml` | ||
| | Property | Scope | Effect | | ||
| | --- | --- | --- | | ||
| | `spotless.skip` | all goals | Skips every Spotless goal (`check`, `apply`, …) | |
There was a problem hiding this comment.
Honor
spotless.skip in every documented goal
When users run mvn spotless:install-git-pre-push-hook -Dspotless.skip, this “all goals” promise is not honored: SpotlessInstallPrePushHookMojo extends AbstractMojo, and its execute() method never reads the global skip property, so it still installs the hook. Either add global-skip handling to that goal or document spotless.skip as covering only check and apply.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Good catch — docs updated: spotless.skip is documented for check/apply only; it does not affect install-git-pre-push-hook.
install-git-pre-push-hook does not read spotless.skip.
Fixes
Fixes #2981
Changes and Review
The Maven README only documented
spotless.check.skip, which made it look like a global switch.spotless.skipandspotless.apply.skipwere already implemented but undocumented.spotless.skip,spotless.check.skip, andspotless.apply.skip(scope + CLI/pom.xmlusage) in the Maven plugin README.SpotlessCheckMojo/SpotlessApplyMojo; keep goal-agnosticspotless.skipon the shared base.check.skipdoes not skip apply, and vice versa).Test Plan
./gradlew :plugin-maven:test --tests 'com.diffplug.spotless.maven.SpotlessCheckMojoTest'— 9/9 GREENPlease DO NOT FORCE PUSH. Don't worry about messy history.