diffplug / diffplug/spotless

spotless-maven-plugin: Allow to overwrite the recommended goal/phase for applying the formatting

Open
#1,988 1 comment 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
5.6k
Forks
559
Avg merge
1d 13h
Merged PRs (30d)
34

Description

In https://github.com/diffplug/spotless/blob/657926464aae27dee2c83c5b28ac6b7e52f2229a/plugin-maven/src/main/java/com/diffplug/spotless/maven/SpotlessCheckMojo.java#L83 the message `Run 'mvn spotless:apply' to fix these violations.` is hard-coded. In some complex setups the configuration for the apply goal only is different than applying it in the context of a regular build. Therefore it should be possible to overwrite the `runToFix` argument with a mojo parameter (but the default should obviously stay as is). That way you can run e.g. with a [particular execution id](https://maven.apache.org/guides/mini/guide-configuring-plugins.html#Using_the_.3Cexecutions.3E_Tag) or a full Maven build up to a certain phase (most probably with a dedicated profile or property parameter) to enable the reformatting.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.