Skip to content

Commit 580037d

Browse files
committed
add to readme as well
1 parent 5c44a8e commit 580037d

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

plugin-gradle/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,21 @@ spotless {
475475
}
476476
```
477477

478+
When used in conjunction with the [buf-gradle-plugin](https://github.com/andrewparmet/buf-gradle-plugin), the `buf` executable can be resolved from its `bufTool` configuration:
479+
480+
```gradle
481+
spotless {
482+
protobuf {
483+
buf().pathToExe(configurations.getByName(BUF_BINARY_CONFIGURATION_NAME).getSingleFile().getAbsolutePath())
484+
}
485+
}
486+
487+
// Be sure to disable the buf-gradle-plugin's native support of `buf format`:
488+
buf {
489+
enforceFormat = false
490+
}
491+
```
492+
478493
## FreshMark
479494

480495
`com.diffplug.gradle.spotless.FreshMarkExtension` [javadoc](https://javadoc.io/doc/com.diffplug.spotless/spotless-plugin-gradle/6.6.0/com/diffplug/gradle/spotless/FreshMarkExtension.html), [code](https://github.com/diffplug/spotless/blob/main/plugin-gradle/src/main/java/com/diffplug/gradle/spotless/FreshMarkExtension.java)

plugin-gradle/src/main/java/com/diffplug/gradle/spotless/ProtobufExtension.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ public class BufFormatExtension {
7676
* <pre>
7777
* {@code
7878
* spotless {
79-
* protobuf {
80-
* buf().pathToExe(configurations.getByName(BUF_BINARY_CONFIGURATION_NAME).singleFile.absolutePath)
81-
* }
79+
* protobuf {
80+
* buf().pathToExe(configurations.getByName(BUF_BINARY_CONFIGURATION_NAME).getSingleFile().getAbsolutePath())
81+
* }
8282
* }
8383
* }
8484
* </pre>
@@ -88,7 +88,7 @@ public class BufFormatExtension {
8888
* <pre>
8989
* {@code
9090
* buf {
91-
* enforceFormat = false
91+
* enforceFormat = false
9292
* }
9393
* }
9494
* </pre>

0 commit comments

Comments
 (0)