You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: private/buf/cmd/buf/command/breaking/breaking.go
+85-16Lines changed: 85 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -30,6 +30,7 @@ import (
30
30
"github.com/bufbuild/buf/private/pkg/app/appext"
31
31
"github.com/bufbuild/buf/private/pkg/slicesext"
32
32
"github.com/bufbuild/buf/private/pkg/stringutil"
33
+
"github.com/bufbuild/buf/private/pkg/syserror"
33
34
"github.com/bufbuild/buf/private/pkg/wasm"
34
35
"github.com/spf13/pflag"
35
36
)
@@ -42,6 +43,7 @@ const (
42
43
configFlagName="config"
43
44
againstFlagName="against"
44
45
againstConfigFlagName="against-config"
46
+
againstRegistryFlagName="against-registry"
45
47
excludePathsFlagName="exclude-path"
46
48
disableSymlinksFlagName="disable-symlinks"
47
49
)
@@ -77,6 +79,7 @@ type flags struct {
77
79
Configstring
78
80
Againststring
79
81
AgainstConfigstring
82
+
AgainstRegistrybool
80
83
ExcludePaths []string
81
84
DisableSymlinksbool
82
85
// special
@@ -129,7 +132,8 @@ Overrides --%s`,
129
132
againstFlagName,
130
133
"",
131
134
fmt.Sprintf(
132
-
`Required. The source, module, or image to check against. Must be one of format %s`,
135
+
`Required, except if --%s is set. The source, module, or image to check against. Must be one of format %s`,
136
+
againstRegistryFlagName,
133
137
buffetch.AllFormatsString,
134
138
),
135
139
)
@@ -139,14 +143,24 @@ Overrides --%s`,
139
143
"",
140
144
`The buf.yaml file or data to use to configure the against source, module, or image`,
141
145
)
146
+
flagSet.BoolVar(
147
+
&f.AgainstRegistry,
148
+
againstRegistryFlagName,
149
+
false,
150
+
fmt.Sprintf(
151
+
`Run breaking checks against the latest commit on the default branch in the registry. All modules in the input must have a name configured, otherwise this will fail.
152
+
If a remote module is not found with the configured name, then this will fail. This cannot be set with --%s.`,
0 commit comments