Skip to content

Commit 55695b3

Browse files
committed
Add -PspotlessFiles= parameter to Gradle plugin docs
1 parent 9bc702f commit 55695b3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

plugin-gradle/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ Spotless supports all of Gradle's built-in performance features (incremental bui
9292
- [Disabling warnings and error messages](#disabling-warnings-and-error-messages)
9393
- [Dependency resolution modes](#dependency-resolution-modes)
9494
- [How do I preview what `spotlessApply` will do?](#how-do-i-preview-what-spotlessapply-will-do)
95+
- [Can I apply Spotless to specific files?](#can-i-apply-spotless-to-specific-files)
9596
- [Example configurations (from real-world projects)](#example-configurations-from-real-world-projects)
9697

9798
***Contributions are welcome, see [the contributing guide](../CONTRIBUTING.md) for development info.***
@@ -1897,6 +1898,16 @@ If you use this feature, you will get an error if you use a formatter in a subpr
18971898
18981899
<a name="examples"></a>
18991900
1901+
## Can I apply Spotless to specific files?
1902+
1903+
You can target specific files by setting the `spotlessFiles` project property to a comma-separated list of file patterns:
1904+
1905+
```
1906+
cmd> gradle spotlessApply -PspotlessFiles=my/file/pattern.java,more/generic/.*-pattern.java
1907+
```
1908+
1909+
The patterns are matched using `String#matches(String)` against the absolute file path.
1910+
19001911
## Example configurations (from real-world projects)
19011912
19021913
* [A few thousand github projects](https://github.com/search?l=gradle&q=spotless&type=Code)

0 commit comments

Comments
 (0)