From 3125f972f1b9883a9452c0ef8abb65cdea43ebac Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Sat, 7 Jan 2023 08:56:44 -0800 Subject: [PATCH 1/2] Our java example was ordered such that the import order would get wiped out by gjf, leading to confusion in #1417. --- plugin-maven/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugin-maven/README.md b/plugin-maven/README.md index dcc18a5dd6..da39543cc4 100644 --- a/plugin-maven/README.md +++ b/plugin-maven/README.md @@ -179,6 +179,10 @@ any other maven phase (i.e. compile) then it can be configured as below; src/test/java/**/*.java + + + + false @@ -188,10 +192,6 @@ any other maven phase (i.e. compile) then it can be configured as below; - - - - From bd562c1365e1b603d7202d66d1d34657ae9baebb Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Sat, 7 Jan 2023 09:06:34 -0800 Subject: [PATCH 2/2] Emphasize that order matters to the Maven users. --- plugin-maven/README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/plugin-maven/README.md b/plugin-maven/README.md index da39543cc4..8440a4368e 100644 --- a/plugin-maven/README.md +++ b/plugin-maven/README.md @@ -129,7 +129,16 @@ To use it in your pom, just [add the Spotless dependency](https://search.maven.o Spotless consists of a list of formats (in the example above, `misc` and `java`), and each format has: - a `target` (the files to format), which you set with [`includes` and `excludes`](https://github.com/diffplug/spotless/blob/989abbecff4d8373c6111c1a98f359eadc532429/plugin-maven/src/main/java/com/diffplug/spotless/maven/FormatterFactory.java#L51-L55) - a list of `FormatterStep`, which are just `String -> String` functions, such as [`replace`](https://github.com/diffplug/spotless/blob/main/plugin-maven/src/main/java/com/diffplug/spotless/maven/generic/Replace.java), [`replaceRegex`](https://github.com/diffplug/spotless/blob/main/plugin-maven/src/main/java/com/diffplug/spotless/maven/generic/ReplaceRegex.java), [`trimTrailingWhitespace`](https://github.com/diffplug/spotless/blob/main/plugin-maven/src/main/java/com/diffplug/spotless/maven/generic/TrimTrailingWhitespace.java), [`indent`](https://github.com/diffplug/spotless/blob/main/plugin-maven/src/main/java/com/diffplug/spotless/maven/generic/Indent.java), [`prettier`](https://github.com/diffplug/spotless/blob/main/plugin-maven/src/main/java/com/diffplug/spotless/maven/generic/Prettier.java), [`eclipseWtp`](https://github.com/diffplug/spotless/blob/main/plugin-maven/src/main/java/com/diffplug/spotless/maven/generic/EclipseWtp.java), and [`licenseHeader`](https://github.com/diffplug/spotless/blob/main/plugin-maven/src/main/java/com/diffplug/spotless/maven/generic/LicenseHeader.java). - +- **order matters**, and this is good! (More info [here](https://github.com/diffplug/spotless/blob/main/PADDEDCELL.md) and [here](https://github.com/diffplug/spotless/blob/main/CONTRIBUTING.md#how-spotless-works)) + - For example, `googleJavaFormat` always indents with spaces, but some wish it had a tab mode + - ```xml + // this works + true2 + ``` + - ```xml + true2 + // the tab indentation gets overwritten + ``` ### Requirements