Skip to content

Commit

Permalink
Add warnings that buf must be the first step.
Browse files Browse the repository at this point in the history
  • Loading branch information
nedtwigg committed Jul 16, 2023
1 parent 0943a81 commit 0fc9036
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions plugin-gradle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,8 @@ black().pathToExe('C:/myuser/.pyenv/versions/3.8.0/scripts/black.exe')
`com.diffplug.gradle.spotless.ProtobufExtension` [javadoc](https://javadoc.io/doc/com.diffplug.spotless/spotless-plugin-gradle/6.19.0/com/diffplug/gradle/spotless/ProtobufExtension.html), [code](https://github.com/diffplug/spotless/blob/main/plugin-gradle/src/main/java/com/diffplug/gradle/spotless/ProtobufExtension.java)
**WARNING** this step **must** be the first step in the chain, steps before it will be ignored. Thumbs up [this issue](https://github.com/bufbuild/buf/issues/1035) for a resolution, see [here](https://github.com/diffplug/spotless/pull/1208#discussion_r1264439669) for more details on the problem.
```gradle
spotless {
protobuf {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ public class BufFormatExtension {

BufFormatExtension(String version) {
this.step = BufStep.withVersion(version);
if (!steps.isEmpty()) {
throw new IllegalArgumentException("buf() must be the first step, move other steps after it. Thumbs up [this issue](https://github.com/bufbuild/buf/issues/1035) for a resolution, see [here](https://github.com/diffplug/spotless/pull/1208#discussion_r1264439669) for more details on the problem.");
}
addStep(createStep());
}

Expand Down

0 comments on commit 0fc9036

Please sign in to comment.