@@ -42,6 +42,15 @@ public LicenseHeaderConfig licenseHeaderFile(Object licenseHeaderFile) {
42
42
return licenseHeaderFile (licenseHeaderFile , LICENSE_HEADER_DELIMITER );
43
43
}
44
44
45
+ /** If the user hasn't specified files, assume all protobuf files should be checked. */
46
+ @ Override
47
+ protected void setupTask (SpotlessTask task ) {
48
+ if (target == null ) {
49
+ target = parseTarget ("**/*.proto" );
50
+ }
51
+ super .setupTask (task );
52
+ }
53
+
45
54
/** Adds the specified version of <a href="https://buf.build/">buf</a>. */
46
55
public BufFormatExtension buf (String version ) {
47
56
Objects .requireNonNull (version );
@@ -53,24 +62,21 @@ public BufFormatExtension buf() {
53
62
}
54
63
55
64
public class BufFormatExtension {
56
- private final String version ;
65
+ BufStep step ;
57
66
58
67
BufFormatExtension (String version ) {
59
- this .version = version ;
68
+ this .step = BufStep . withVersion ( version ) ;
60
69
addStep (createStep ());
61
70
}
62
71
63
- private FormatterStep createStep () {
64
- return BufStep .withVersion (version ).create ();
72
+ public BufFormatExtension pathToExe (String pathToExe ) {
73
+ step = step .withPathToExe (pathToExe );
74
+ replaceStep (createStep ());
75
+ return this ;
65
76
}
66
- }
67
77
68
- /** If the user hasn't specified files, assume all protobuf files should be checked. */
69
- @ Override
70
- protected void setupTask (SpotlessTask task ) {
71
- if (target == null ) {
72
- target = parseTarget ("**/*.proto" );
78
+ private FormatterStep createStep () {
79
+ return step .create ();
73
80
}
74
- super .setupTask (task );
75
81
}
76
82
}
0 commit comments