Repository: bufbuild/buf
Pull request #943 (2022-02-15 02:33:47)

Update decode command help text
Some very nit-picky updates to the `buf beta decode` help text.


Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index cb3fef020..d18ce4f9e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -21,6 +21,12 @@
   details.
 - Context modifier no longer overrides an existing token on the context. This allows `buf registry login`
   to properly check the user provided token without the token being overriden by the CLI interceptor.
+- Removed the `buf config init` command in favor of `buf mod init`.
+- Removed the `buf config ls-breaking-rules` command in favor of `buf mod ls-breaking-rules`.
+- Removed the `buf config ls-lint-rules` command in favor of `buf mod ls-lint-rules`.
+- Removed the `buf config migrate-v1beta1` command in favor of `buf beta migrate-v1beta1`.
+- Add `buf beta decode` command to decode message with provided image source and message type.
+- Disable `--config` flag for workspaces.
 
 ## [v1.0.0-rc12] - 2022-02-01
 
diff --git a/private/buf/bufwork/workspace_builder.go b/private/buf/bufwork/workspace_builder.go
index 3a227edba..6950811b2 100644
--- a/private/buf/bufwork/workspace_builder.go
+++ b/private/buf/bufwork/workspace_builder.go
@@ -56,6 +56,9 @@ func (w *workspaceBuilder) BuildWorkspace(
 	if workspaceConfig == nil {
 		return nil, errors.New("received a nil workspace config")
 	}
+	if configOverride != "" {
+		return nil, errors.New("the --config flag is not compatible with workspaces")
+	}
 	// We know that if the file is actually buf.work for legacy reasons, this will be wrong,
 	// but we accept that as this shouldn't happen often anymore and this is just
 	// used for error messages.
diff --git a/private/buf/cmd/buf/buf.go b/private/buf/cmd/buf/buf.go
index e1c2d9534..c85b582af 100644
--- a/private/buf/cmd/buf/buf.go
+++ b/private/buf/cmd/buf/buf.go
@@ -25,6 +25,7 @@ import (
 	"github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/registry/token/tokenget"
 	"github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/registry/token/tokenlist"
 	"github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/decode"
+	"github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/migratev1beta1"
 	"github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/commit/commitget"
 	"github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/commit/commitlist"
 	"github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/organization/organizationcreate"
@@ -55,15 +56,14 @@ import (
 	"github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/track/tracklist"
 	"github.com/bufbuild/buf/private/buf/cmd/buf/command/breaking"
 	"github.com/bufbuild/buf/private/buf/cmd/buf/command/build"
-	"github.com/bufbuild/buf/private/buf/cmd/buf/command/config/configinit"
-	"github.com/bufbuild/buf/private/buf/cmd/buf/command/config/configlsbreakingrules"
-	"github.com/bufbuild/buf/private/buf/cmd/buf/command/config/configlslintrules"
-	"github.com/bufbuild/buf/private/buf/cmd/buf/command/config/configmigratev1beta1"
 	"github.com/bufbuild/buf/private/buf/cmd/buf/command/export"
 	"github.com/bufbuild/buf/private/buf/cmd/buf/command/generate"
 	"github.com/bufbuild/buf/private/buf/cmd/buf/command/lint"
 	"github.com/bufbuild/buf/private/buf/cmd/buf/command/lsfiles"
 	"github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modclearcache"
+	"github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modinit"
+	"github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modlsbreakingrules"
+	"github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modlslintrules"
 	"github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modopen"
 	"github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modprune"
 	"github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modupdate"
@@ -107,20 +107,13 @@ func NewRootCommand(name string) *appcmd.Command {
 				Use:   "mod",
 				Short: "Manage Buf modules.",
 				SubCommands: []*appcmd.Command{
+					modinit.NewCommand("init", builder),
 					modprune.NewCommand("prune", builder),
 					modupdate.NewCommand("update", builder),
 					modopen.NewCommand("open", builder),
 					modclearcache.NewCommand("clear-cache", builder, "cc"),
-				},
-			},
-			{
-				Use:   "config",
-				Short: "Manage Buf module configuration.",
-				SubCommands: []*appcmd.Command{
-					configinit.NewCommand("init", builder),
-					configlslintrules.NewCommand("ls-lint-rules", builder),
-					configlsbreakingrules.NewCommand("ls-breaking-rules", builder),
-					configmigratev1beta1.NewCommand("migrate-v1beta1", builder),
+					modlslintrules.NewCommand("ls-lint-rules", builder),
+					modlsbreakingrules.NewCommand("ls-breaking-rules", builder),
 				},
 			},
 			{
@@ -136,6 +129,7 @@ func NewRootCommand(name string) *appcmd.Command {
 				Short: "Beta commands. Unstable and likely to change.",
 				SubCommands: []*appcmd.Command{
 					decode.NewCommand("decode", builder),
+					migratev1beta1.NewCommand("migrate-v1beta1", builder),
 					{
 						Use:   "registry",
 						Short: "Manage assets on the Buf Schema Registry.",
diff --git a/private/buf/cmd/buf/command/beta/decode/decode.go b/private/buf/cmd/buf/command/beta/decode/decode.go
index 67d4b5d28..1beb89b45 100644
--- a/private/buf/cmd/buf/command/beta/decode/decode.go
+++ b/private/buf/cmd/buf/command/beta/decode/decode.go
@@ -44,10 +44,10 @@ func NewCommand(
 ) *appcmd.Command {
 	flags := newFlags()
 	return &appcmd.Command{
-		Use:   name,
-		Short: "Decode binary serialized message with a source reference.",
-		Long: `The first argument is the source that defines the serialized message (e.g. buf.build/acme/weather).
-If no argument is specified, the type provided must be a fully-qualified path to the type (e.g. buf.build/acme/weather#acme.weather.v1.Units).`,
+		Use:   name + " <source>",
+		Short: "Use a source reference to decode a binary serialized message supplied through stdin.",
+		Long: `The first argument is the source that defines the serialized message (like buf.build/acme/weather).
+Alternatively, you can omit the source and specify a fully qualified path for the type using the --type option (like buf.build/acme/weather#acme.weather.v1.Units).`,
 		Args: cobra.MaximumNArgs(1),
 		Run: builder.NewRunFunc(
 			func(ctx context.Context, container appflag.Container) error {
@@ -75,7 +75,7 @@ func (f *flags) Bind(flagSet *pflag.FlagSet) {
 		errorFormatFlagName,
 		"text",
 		fmt.Sprintf(
-			"The format for build errors, printed to stderr. Must be one of %s.",
+			"The format for build errors printed to stderr. Must be one of %s.",
 			stringutil.SliceToString(bufanalysis.AllFormatStrings),
 		),
 	)
@@ -83,8 +83,8 @@ func (f *flags) Bind(flagSet *pflag.FlagSet) {
 		&f.Type,
 		typeFlagName,
 		"",
-		`The full type name of the serialized message (e.g. acme.weather.v1.Units)
-Alternatively, this can be a fully-qualified path to the type (e.g. buf.build/acme/weather#acme.weather.v1.Units) without providing the source`,
+		`The full type name of the serialized message (like acme.weather.v1.Units).
+Alternatively, this can be a fully qualified path to the type without providing the source (like buf.build/acme/weather#acme.weather.v1.Units).`,
 	)
 	flagSet.StringVarP(
 		&f.Output,
@@ -93,7 +93,7 @@ Alternatively, this can be a fully-qualified path to the type (e.g. buf.build/ac
 		"-",
 		// TODO: If we ever support other formats (e.g. prototext), we will need
 		// to build a buffetch.ProtoEncodingRefParser.
-		`The location to write the decoded result to. This is always JSON for now.`,
+		`The location to write the decoded result to. Output is currently only in JSON form.`,
 	)
 }
 
diff --git a/private/buf/cmd/buf/command/config/configmigratev1beta1/configmigratev1beta1.go b/private/buf/cmd/buf/command/beta/migratev1beta1/migratev1beta1.go
similarity index 98%
rename from private/buf/cmd/buf/command/config/configmigratev1beta1/configmigratev1beta1.go
rename to private/buf/cmd/buf/command/beta/migratev1beta1/migratev1beta1.go
index 47cffa32c..d64d76b35 100644
--- a/private/buf/cmd/buf/command/config/configmigratev1beta1/configmigratev1beta1.go
+++ b/private/buf/cmd/buf/command/beta/migratev1beta1/migratev1beta1.go
@@ -12,7 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package configmigratev1beta1
+package migratev1beta1
 
 import (
 	"context"
diff --git a/private/buf/cmd/buf/command/config/configlslintrules/usage.gen.go b/private/buf/cmd/buf/command/beta/migratev1beta1/usage.gen.go
similarity index 96%
rename from private/buf/cmd/buf/command/config/configlslintrules/usage.gen.go
rename to private/buf/cmd/buf/command/beta/migratev1beta1/usage.gen.go
index 7aa76f771..05a6adb68 100644
--- a/private/buf/cmd/buf/command/config/configlslintrules/usage.gen.go
+++ b/private/buf/cmd/buf/command/beta/migratev1beta1/usage.gen.go
@@ -14,6 +14,6 @@
 
 // Generated. DO NOT EDIT.
 
-package configlslintrules
+package migratev1beta1
 
 import _ "github.com/bufbuild/buf/private/usage"
diff --git a/private/buf/cmd/buf/command/config/internal/internal.go b/private/buf/cmd/buf/command/mod/internal/internal.go
similarity index 100%
rename from private/buf/cmd/buf/command/config/internal/internal.go
rename to private/buf/cmd/buf/command/mod/internal/internal.go
diff --git a/private/buf/cmd/buf/command/config/internal/usage.gen.go b/private/buf/cmd/buf/command/mod/internal/usage.gen.go
similarity index 100%
rename from private/buf/cmd/buf/command/config/internal/usage.gen.go
rename to private/buf/cmd/buf/command/mod/internal/usage.gen.go
diff --git a/private/buf/cmd/buf/command/config/configinit/configinit.go b/private/buf/cmd/buf/command/mod/modinit/modinit.go
similarity index 99%
rename from private/buf/cmd/buf/command/config/configinit/configinit.go
rename to private/buf/cmd/buf/command/mod/modinit/modinit.go
index ff6a2dcf9..01f19f9ef 100644
--- a/private/buf/cmd/buf/command/config/configinit/configinit.go
+++ b/private/buf/cmd/buf/command/mod/modinit/modinit.go
@@ -12,7 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package configinit
+package modinit
 
 import (
 	"context"
diff --git a/private/buf/cmd/buf/command/config/configinit/usage.gen.go b/private/buf/cmd/buf/command/mod/modinit/usage.gen.go
similarity index 97%
rename from private/buf/cmd/buf/command/config/configinit/usage.gen.go
rename to private/buf/cmd/buf/command/mod/modinit/usage.gen.go
index 55311aaea..14ba321d8 100644
--- a/private/buf/cmd/buf/command/config/configinit/usage.gen.go
+++ b/private/buf/cmd/buf/command/mod/modinit/usage.gen.go
@@ -14,6 +14,6 @@
 
 // Generated. DO NOT EDIT.
 
-package configinit
+package modinit
 
 import _ "github.com/bufbuild/buf/private/usage"
diff --git a/private/buf/cmd/buf/command/config/configlsbreakingrules/configlsbreakingrules.go b/private/buf/cmd/buf/command/mod/modlsbreakingrules/modlsbreakingrules.go
similarity index 88%
rename from private/buf/cmd/buf/command/config/configlsbreakingrules/configlsbreakingrules.go
rename to private/buf/cmd/buf/command/mod/modlsbreakingrules/modlsbreakingrules.go
index 38822295f..f493a410c 100644
--- a/private/buf/cmd/buf/command/config/configlsbreakingrules/configlsbreakingrules.go
+++ b/private/buf/cmd/buf/command/mod/modlsbreakingrules/modlsbreakingrules.go
@@ -12,13 +12,13 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package configlsbreakingrules
+package modlsbreakingrules
 
 import (
 	"context"
 	"fmt"
 
-	configinternal "github.com/bufbuild/buf/private/buf/cmd/buf/command/config/internal"
+	modinternal "github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/internal"
 	"github.com/bufbuild/buf/private/bufpkg/bufcheck"
 	"github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking"
 	"github.com/bufbuild/buf/private/bufpkg/bufconfig"
@@ -67,10 +67,10 @@ func newFlags() *flags {
 }
 
 func (f *flags) Bind(flagSet *pflag.FlagSet) {
-	configinternal.BindLSRulesAll(flagSet, &f.All, allFlagName)
-	configinternal.BindLSRulesConfig(flagSet, &f.Config, configFlagName, allFlagName, versionFlagName)
-	configinternal.BindLSRulesFormat(flagSet, &f.Format, formatFlagName)
-	configinternal.BindLSRulesVersion(flagSet, &f.Version, versionFlagName, allFlagName)
+	modinternal.BindLSRulesAll(flagSet, &f.All, allFlagName)
+	modinternal.BindLSRulesConfig(flagSet, &f.Config, configFlagName, allFlagName, versionFlagName)
+	modinternal.BindLSRulesFormat(flagSet, &f.Format, formatFlagName)
+	modinternal.BindLSRulesVersion(flagSet, &f.Version, versionFlagName, allFlagName)
 }
 
 func run(
diff --git a/private/buf/cmd/buf/command/config/configmigratev1beta1/usage.gen.go b/private/buf/cmd/buf/command/mod/modlsbreakingrules/usage.gen.go
similarity index 95%
rename from private/buf/cmd/buf/command/config/configmigratev1beta1/usage.gen.go
rename to private/buf/cmd/buf/command/mod/modlsbreakingrules/usage.gen.go
index 73cbd68e2..873d6b6f7 100644
--- a/private/buf/cmd/buf/command/config/configmigratev1beta1/usage.gen.go
+++ b/private/buf/cmd/buf/command/mod/modlsbreakingrules/usage.gen.go
@@ -14,6 +14,6 @@
 
 // Generated. DO NOT EDIT.
 
-package configmigratev1beta1
+package modlsbreakingrules
 
 import _ "github.com/bufbuild/buf/private/usage"
diff --git a/private/buf/cmd/buf/command/config/configlslintrules/configlslintrules.go b/private/buf/cmd/buf/command/mod/modlslintrules/modlslintrules.go
similarity index 88%
rename from private/buf/cmd/buf/command/config/configlslintrules/configlslintrules.go
rename to private/buf/cmd/buf/command/mod/modlslintrules/modlslintrules.go
index 8442cfb22..cc81e50ac 100644
--- a/private/buf/cmd/buf/command/config/configlslintrules/configlslintrules.go
+++ b/private/buf/cmd/buf/command/mod/modlslintrules/modlslintrules.go
@@ -12,13 +12,13 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package configlslintrules
+package modlslintrules
 
 import (
 	"context"
 	"fmt"
 
-	configinternal "github.com/bufbuild/buf/private/buf/cmd/buf/command/config/internal"
+	modinternal "github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/internal"
 	"github.com/bufbuild/buf/private/bufpkg/bufcheck"
 	"github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint"
 	"github.com/bufbuild/buf/private/bufpkg/bufconfig"
@@ -67,10 +67,10 @@ func newFlags() *flags {
 }
 
 func (f *flags) Bind(flagSet *pflag.FlagSet) {
-	configinternal.BindLSRulesAll(flagSet, &f.All, allFlagName)
-	configinternal.BindLSRulesConfig(flagSet, &f.Config, configFlagName, allFlagName, versionFlagName)
-	configinternal.BindLSRulesFormat(flagSet, &f.Format, formatFlagName)
-	configinternal.BindLSRulesVersion(flagSet, &f.Version, versionFlagName, allFlagName)
+	modinternal.BindLSRulesAll(flagSet, &f.All, allFlagName)
+	modinternal.BindLSRulesConfig(flagSet, &f.Config, configFlagName, allFlagName, versionFlagName)
+	modinternal.BindLSRulesFormat(flagSet, &f.Format, formatFlagName)
+	modinternal.BindLSRulesVersion(flagSet, &f.Version, versionFlagName, allFlagName)
 }
 
 func run(
diff --git a/private/buf/cmd/buf/command/config/configlsbreakingrules/usage.gen.go b/private/buf/cmd/buf/command/mod/modlslintrules/usage.gen.go
similarity index 95%
rename from private/buf/cmd/buf/command/config/configlsbreakingrules/usage.gen.go
rename to private/buf/cmd/buf/command/mod/modlslintrules/usage.gen.go
index efd17f37d..c9cd7e215 100644
--- a/private/buf/cmd/buf/command/config/configlsbreakingrules/usage.gen.go
+++ b/private/buf/cmd/buf/command/mod/modlslintrules/usage.gen.go
@@ -14,6 +14,6 @@
 
 // Generated. DO NOT EDIT.
 
-package configlsbreakingrules
+package modlslintrules
 
 import _ "github.com/bufbuild/buf/private/usage"


Test patch:
diff --git a/private/buf/cmd/buf/buf_test.go b/private/buf/cmd/buf/buf_test.go
index a5f5aad8d..b06fe0e19 100644
--- a/private/buf/cmd/buf/buf_test.go
+++ b/private/buf/cmd/buf/buf_test.go
@@ -244,45 +244,32 @@ func TestFail7(t *testing.T) {
 	testRunStdout(
 		t,
 		nil,
-		bufcli.ExitCodeFileAnnotation,
-		filepath.FromSlash(`testdata/fail/buf/buf.proto:3:1:Files with package "other" must be within a directory "other" relative to root but were in directory "fail/buf".
-        testdata/fail/buf/buf.proto:6:9:Field name "oneTwo" should be lower_snake_case, such as "one_two".`),
+		1,
+		``,
 		"lint",
-		"--path",
 		filepath.Join("testdata", "fail", "buf", "buf.proto"),
-		filepath.Join("testdata"),
-		"--config",
-		`{"version":"v1beta1","lint":{"use":["BASIC"]}}`,
+		"--input-config",
+		`{"version":"v1","lint":{"use":["BASIC"]}}`,
 	)
-	testRunStdout(
+	testRunStdoutStderr(
 		t,
 		nil,
-		bufcli.ExitCodeFileAnnotation,
-		filepath.FromSlash(`testdata/fail/buf/buf.proto:3:1:Files with package "other" must be within a directory "other" relative to root but were in directory "fail/buf".
-        testdata/fail/buf/buf.proto:6:9:Field name "oneTwo" should be lower_snake_case, such as "one_two".`),
+		1,
+		"", // stdout should be empty
+		"Failure: the --config flag is not compatible with workspaces",
 		"lint",
 		"--path",
 		filepath.Join("testdata", "fail", "buf", "buf.proto"),
 		filepath.Join("testdata"),
 		"--config",
-		`{"version":"v1","lint":{"use":["BASIC"]}}`,
+		`{"version":"v1beta1","lint":{"use":["BASIC"]}}`,
 	)
-	testRunStdout(
+	testRunStdoutStderr(
 		t,
 		nil,
 		1,
-		``,
-		"lint",
-		filepath.Join("testdata", "fail", "buf", "buf.proto"),
-		"--input-config",
-		`{"version":"v1","lint":{"use":["BASIC"]}}`,
-	)
-	testRunStdout(
-		t,
-		nil,
-		bufcli.ExitCodeFileAnnotation,
-		filepath.FromSlash(`testdata/fail/buf/buf.proto:3:1:Files with package "other" must be within a directory "other" relative to root but were in directory "buf".
-        testdata/fail/buf/buf.proto:6:9:Field name "oneTwo" should be lower_snake_case, such as "one_two".`),
+		"", // stdout should be empty
+		"Failure: the --config flag is not compatible with workspaces",
 		"lint",
 		filepath.Join("testdata", "fail", "buf", "buf.proto"),
 		"--config",
@@ -546,7 +533,7 @@ PACKAGE_NO_IMPORT_CYCLE                                    Checks that packages
 		nil,
 		0,
 		expectedStdout,
-		"config",
+		"mod",
 		"ls-lint-rules",
 		"--version",
 		"v1",
@@ -564,7 +551,7 @@ func TestCheckLsLintRules2(t *testing.T) {
 		PACKAGE_DIRECTORY_MATCH  MINIMAL, BASIC, DEFAULT, FILE_LAYOUT  Checks that all files are in a directory that matches their package name.
 		ENUM_NO_ALLOW_ALIAS      MINIMAL, BASIC, DEFAULT, SENSIBLE     Checks that enums do not have the allow_alias option set.
 		`,
-		"config",
+		"mod",
 		"ls-lint-rules",
 		"--config",
 		filepath.Join("testdata", "small_list_rules", bufconfig.ExternalConfigV1FilePath),
@@ -622,7 +609,7 @@ ENUM_FIRST_VALUE_ZERO             OTHER                                       Ch
 		nil,
 		0,
 		expectedStdout,
-		"config",
+		"mod",
 		"ls-lint-rules",
 		"--all",
 	)
@@ -695,7 +682,7 @@ FIELD_WIRE_COMPATIBLE_TYPE                      WIRE
 		nil,
 		0,
 		expectedStdout,
-		"config",
+		"mod",
 		"ls-breaking-rules",
 		"--version",
 		"v1",
@@ -713,7 +700,7 @@ func TestCheckLsBreakingRules2(t *testing.T) {
 		ENUM_VALUE_NO_DELETE  FILE, PACKAGE  Checks that enum values are not deleted from a given enum.
 		FIELD_SAME_JSTYPE     FILE, PACKAGE  Checks that fields have the same value for the jstype option.
 		`,
-		"config",
+		"mod",
 		"ls-breaking-rules",
 		"--config",
 		filepath.Join("testdata", "small_list_rules", bufconfig.ExternalConfigV1FilePath),
@@ -731,7 +718,7 @@ func TestCheckLsBreakingRules3(t *testing.T) {
 		ENUM_VALUE_NO_DELETE  FILE, PACKAGE  Checks that enum values are not deleted from a given enum.
 		FIELD_SAME_JSTYPE     FILE, PACKAGE  Checks that fields have the same value for the jstype option.
 		`,
-		"config",
+		"mod",
 		"ls-breaking-rules",
 		"--config",
 		// making sure that .yml works
@@ -804,7 +791,7 @@ FIELD_NO_DELETE_UNLESS_NUMBER_RESERVED          WIRE_JSON, WIRE
 		nil,
 		0,
 		expectedStdout,
-		"config",
+		"mod",
 		"ls-breaking-rules",
 		"--version",
 		"v1beta1",
@@ -1155,9 +1142,9 @@ func TestImageConvertRoundtripJSONBinaryJSON(t *testing.T) {
 	require.Equal(t, json1, stdout.Bytes())
 }
 
-func TestConfigInitBasic(t *testing.T) {
+func TestModInitBasic(t *testing.T) {
 	t.Parallel()
-	testConfigInit(
+	testModInit(
 		t,
 		`version: v1
 breaking:
@@ -1911,7 +1898,7 @@ func testMigrateV1Beta1Diff(
 		0,
 		"",
 		expectedStderr,
-		"config",
+		"beta",
 		"migrate-v1beta1",
 		tempDir,
 	)
@@ -1936,15 +1923,15 @@ func testMigrateV1Beta1Failure(t *testing.T, storageosProvider storageos.Provide
 		1,
 		"",
 		expectedStderr,
-		"config",
+		"beta",
 		"migrate-v1beta1",
 		tempDir,
 	)
 }
 
-func testConfigInit(t *testing.T, expectedData string, document bool, name string, deps ...string) {
+func testModInit(t *testing.T, expectedData string, document bool, name string, deps ...string) {
 	tempDir := t.TempDir()
-	baseArgs := []string{"config", "init"}
+	baseArgs := []string{"mod", "init"}
 	args := append(baseArgs, "-o", tempDir)
 	if document {
 		args = append(args, "--doc")
diff --git a/private/buf/cmd/buf/workspace_test.go b/private/buf/cmd/buf/workspace_test.go
index 8cf47e735..4c9e0479a 100644
--- a/private/buf/cmd/buf/workspace_test.go
+++ b/private/buf/cmd/buf/workspace_test.go
@@ -161,12 +161,12 @@ func TestWorkspaceDir(t *testing.T) {
 			"--against",
 			filepath.Join("testdata", "workspace", "success", baseDirPath),
 		)
-		testRunStdout(
+		testRunStdoutStderr(
 			t,
 			nil,
-			bufcli.ExitCodeFileAnnotation,
-			filepath.FromSlash(`testdata/workspace/success/`+baseDirPath+`/other/proto/request.proto:3:1:Files with package "request" must be within a directory "request" relative to root but were in directory ".".
-		    testdata/workspace/success/`+baseDirPath+`/proto/rpc.proto:3:1:Files with package "example" must be within a directory "example" relative to root but were in directory ".".`),
+			1,
+			"", // stdout should be empty
+			"Failure: the --config flag is not compatible with workspaces",
 			"lint",
 			filepath.Join("testdata", "workspace", "success", baseDirPath),
 			"--config",
@@ -194,23 +194,12 @@ func TestWorkspaceDir(t *testing.T) {
 			"--path",
 			filepath.Join("testdata", "workspace", "success", baseDirPath, "other", "proto", "request.proto"),
 		)
-		testRunStdout(
+		testRunStdoutStderr(
 			t,
 			nil,
-			bufcli.ExitCodeFileAnnotation,
-			filepath.FromSlash(`testdata/workspace/success/`+baseDirPath+`/proto/rpc.proto:3:1:Files with package "example" must be within a directory "example" relative to root but were in directory ".".`),
-			"lint",
-			filepath.Join("testdata", "workspace", "success", baseDirPath),
-			"--config",
-			`{"version":"v1","lint": {"use": ["PACKAGE_DIRECTORY_MATCH"]}}`,
-			"--path",
-			filepath.Join("testdata", "workspace", "success", baseDirPath, "proto", "rpc.proto"),
-		)
-		testRunStdout(
-			t,
-			nil,
-			bufcli.ExitCodeFileAnnotation,
-			filepath.FromSlash(`testdata/workspace/success/`+baseDirPath+`/other/proto/request.proto:3:1:Files with package "request" must be within a directory "request" relative to root but were in directory ".".`),
+			1,
+			"", // stdout should be empty
+			"Failure: the --config flag is not compatible with workspaces",
 			"lint",
 			filepath.Join("testdata", "workspace", "success", baseDirPath),
 			"--config",
@@ -218,32 +207,6 @@ func TestWorkspaceDir(t *testing.T) {
 			"--path",
 			filepath.Join("testdata", "workspace", "success", baseDirPath, "other", "proto", "request.proto"),
 		)
-		testRunStdout(
-			t,
-			nil,
-			bufcli.ExitCodeFileAnnotation,
-			filepath.FromSlash(`testdata/workspace/success/`+baseDirPath+`/other/proto/request.proto:3:1:Files with package "request" must be within a directory "request" relative to root but were in directory ".".`),
-			"lint",
-			filepath.Join("testdata", "workspace", "success", baseDirPath),
-			"--config",
-			`{"version":"v1","lint": {"use": ["PACKAGE_DIRECTORY_MATCH"]}}`,
-			"--path",
-			filepath.Join(wd, "testdata", "workspace", "success", baseDirPath, "other", "proto", "request.proto"),
-		)
-		testRunStdout(
-			t,
-			nil,
-			bufcli.ExitCodeFileAnnotation,
-			filepath.FromSlash(fmt.Sprintf(`%s/testdata/workspace/success/`+baseDirPath+`/other/proto/request.proto:3:1:Files with package "request" must be within a directory "request" relative to root but were in directory ".".`,
-				wd,
-			)),
-			"lint",
-			filepath.Join(wd, "testdata", "workspace", "success", baseDirPath),
-			"--config",
-			`{"version":"v1","lint": {"use": ["PACKAGE_DIRECTORY_MATCH"]}}`,
-			"--path",
-			filepath.Join(wd, "testdata", "workspace", "success", baseDirPath, "other", "proto", "request.proto"),
-		)
 	}
 }