Skip to content

Commit bd562c1

Browse files
committed
Emphasize that order matters to the Maven users.
1 parent 3125f97 commit bd562c1

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

plugin-maven/README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,16 @@ To use it in your pom, just [add the Spotless dependency](https://search.maven.o
129129
Spotless consists of a list of formats (in the example above, `misc` and `java`), and each format has:
130130
- 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)
131131
- 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).
132-
132+
- **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))
133+
- For example, `googleJavaFormat` always indents with spaces, but some wish it had a tab mode
134+
- ```xml
135+
<googleJavaFormat/> // this works
136+
<indent><tabs>true</tabs><spacesPerTab>2</spacesPerTab></indent>
137+
```
138+
- ```xml
139+
<indent><tabs>true</tabs><spacesPerTab>2</spacesPerTab></indent>
140+
<googleJavaFormat/> // the tab indentation gets overwritten
141+
```
133142

134143
### Requirements
135144

0 commit comments

Comments
 (0)