Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos #3578

Merged
merged 1 commit into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
- Add `buf registry plugin {create,delete,info,update}` commands to manage BSR plugins.
- Breaking analysis support for `buf beta lsp`.
- Fix bug when using the `--type` flag filter for `buf build` where import ordering is not
determinisitic.
deterministic.
- Add `buf plugin push` command to push a plugin to the Buf Schema Registry.
Only WebAssembly check plugins are supported at this time.
- Add `buf plugin update` and `buf plugin prune` command to manage plugins in the `buf.lock`
Expand Down Expand Up @@ -855,15 +855,15 @@ curl -sSL https://github.com/bufbuild/buf/releases/download/v0.57.0/protoc-gen-b
## [v0.56.0] - 2021-09-08

- Cascade `ENUM_ZERO_VALUE_SUFFIX` comment ignores from the enum level.
- Fix issue where `buf genarate --output` was not being respected in 0.55.0.
- Fix issue where `buf generate --output` was not being respected in 0.55.0.

## [v0.55.0] - 2021-09-07

- Error if `version:` is not set in `buf.yaml`. This is one of the few breaking changes we must make before v1.0 to guarantee stability for the future. If you do not have a version set, simply add `version: v1beta1` to the top of your `buf.yaml`.
- Support `BUF_TOKEN` for authentication. `buf` will now look for a token in the `BUF_TOKEN` environment variable, falling back to `.netrc` as set via `buf login`.
- Add support for using remote plugins with local source files.
- Add per-file overrides for managed mode.
- Fix issue with the module cache where multiple simulataneous downloads would result in a temporarily-corrupted cache.
- Fix issue with the module cache where multiple simultaneous downloads would result in a temporarily-corrupted cache.
- Hide verbose messaing behind the `--verbose` (`-v`) flag.
- Add `--debug` flag to print out debug logging.

Expand Down
8 changes: 4 additions & 4 deletions private/buf/bufcli/flags_args.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ const (
)

var (
// allVisibiltyStrings are the possible options that a user can set the visibility flag with.
allVisibiltyStrings = []string{
// allVisibilityStrings are the possible options that a user can set the visibility flag with.
allVisibilityStrings = []string{
publicVisibility,
privateVisibility,
}
Expand Down Expand Up @@ -153,7 +153,7 @@ func BindVisibility(flagSet *pflag.FlagSet, addr *string, flagName string, empty
addr,
flagName,
defaultVisibility,
fmt.Sprintf(`The module's visibility setting. Must be one of %s`, stringutil.SliceToString(allVisibiltyStrings)),
fmt.Sprintf(`The module's visibility setting. Must be one of %s`, stringutil.SliceToString(allVisibilityStrings)),
)
}

Expand All @@ -164,7 +164,7 @@ func BindCreateVisibility(flagSet *pflag.FlagSet, addr *string, flagName string,
addr,
flagName,
privateVisibility,
fmt.Sprintf(`The module's visibility setting, if created. Can only be set with --%s. Must be one of %s`, createFlagName, stringutil.SliceToString(allVisibiltyStrings)),
fmt.Sprintf(`The module's visibility setting, if created. Can only be set with --%s. Must be one of %s`, createFlagName, stringutil.SliceToString(allVisibilityStrings)),
)
}

Expand Down
2 changes: 1 addition & 1 deletion private/buf/bufctl/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func WithImageAsFileDescriptorSet(imageAsFileDescriptorSet bool) FunctionOption
// If used with an image or module ref, this has no effect on the build, i.e. excludes are
// not respected, and the module name is ignored. This matches old behavior.
//
// This implements the soon-to-be-deprected --config flag.
// This implements the soon-to-be-deprecated --config flag.
//
// See bufconfig.GetBufYAMLFileForPrefixOrOverride for more details.
//
Expand Down
2 changes: 1 addition & 1 deletion private/buf/buffetch/buffetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ type MessageRef interface {
MessageEncoding() MessageEncoding
// Path returns the path of the file.
//
// May be used for items such as YAML unmarshaling errors.
// May be used for items such as YAML unmarshalling errors.
Path() string
// UseProtoNames only applies for MessageEncodingYAML at this time.
UseProtoNames() bool
Expand Down
2 changes: 1 addition & 1 deletion private/buf/buffetch/internal/internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ type BucketExtender interface {
// SubDirPath is the subdir within the Bucket of the actual asset.
//
// This will be set if a terminate file was found. If so, the actual Bucket will be
// the directory that contained this terminate file, and the subDirPath will be the sub-direftory of
// the directory that contained this terminate file, and the subDirPath will be the sub-directory of
// the actual asset relative to the terminate file.
SubDirPath() string
}
Expand Down
8 changes: 4 additions & 4 deletions private/buf/buffetch/internal/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ func getReadWriteBucketForOS(
// osRootBucketTargeting returns the information on whether or not a controlling
// workspace was found based on the inputDirPath.
//
// *** CONTROLLING WOKRSPACE FOUND ***
// *** CONTROLLING WORKSPACE FOUND ***
//
// In the case where a controlling workspace is found, we want to create a new bucket
// for the controlling workspace.
Expand All @@ -687,11 +687,11 @@ func getReadWriteBucketForOS(
//
// We do not need to remap the input dir, target paths, and target exclude paths
// returned by buftarget.BucketTargeting, because they are already relative to the
// controlling workpsace.
// controlling workspace.
//
// *** CONTROLLING WOKRSPACE NOT FOUND ***
// *** CONTROLLING WORKSPACE NOT FOUND ***
//
// In the case where a controlling workpsace is not found, we have three outcomes for
// In the case where a controlling workspace is not found, we have three outcomes for
// creating a new bucket.
// If the inputDirPath is an absolute path, we want to use an absolute path to the input
// path:
Expand Down
8 changes: 4 additions & 4 deletions private/buf/bufformat/formatter.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func (f *formatter) Indent(nextNode ast.Node) {
// WriteString writes the given element to the generated output.
//
// This will not write indentation or newlines. Use P if you
// want to emit identation or newlines.
// want to emit indentation or newlines.
func (f *formatter) WriteString(elem string) {
if f.pendingSpace {
f.pendingSpace = false
Expand Down Expand Up @@ -886,7 +886,7 @@ func (f *formatter) writeField(fieldNode *ast.FieldNode) {
// If a label was not written, the multiline comments will be
// attached to the type.
if compoundIdentNode, ok := fieldNode.FldType.(*ast.CompoundIdentNode); ok {
f.writeCompountIdentForFieldName(compoundIdentNode)
f.writeCompoundIdentForFieldName(compoundIdentNode)
} else {
f.writeStart(fieldNode.FldType)
}
Expand Down Expand Up @@ -1500,7 +1500,7 @@ func (f *formatter) writeCompoundIdent(compoundIdentNode *ast.CompoundIdentNode)
}
}

// writeCompountIdentForFieldName writes a compound identifier, but handles comments
// writeCompoundIdentForFieldName writes a compound identifier, but handles comments
// specially for field names.
//
// For example,
Expand All @@ -1509,7 +1509,7 @@ func (f *formatter) writeCompoundIdent(compoundIdentNode *ast.CompoundIdentNode)
// // These are comments attached to bar.
// bar.v1.Bar bar = 1;
// }
func (f *formatter) writeCompountIdentForFieldName(compoundIdentNode *ast.CompoundIdentNode) {
func (f *formatter) writeCompoundIdentForFieldName(compoundIdentNode *ast.CompoundIdentNode) {
if compoundIdentNode.LeadingDot != nil {
f.writeStart(compoundIdentNode.LeadingDot)
}
Expand Down
2 changes: 1 addition & 1 deletion private/buf/bufformat/formatter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func testFormatNoDiff(t *testing.T, path string) {
func(formattedFile storage.ReadObject) error {
expectedPath := formattedFile.Path()
t.Run(expectedPath, func(t *testing.T) {
// The expecetd format result is the golden file. If
// The expected format result is the golden file. If
// this file IS a golden file, it is expected to not
// change.
if !strings.HasSuffix(expectedPath, ".golden.proto") {
Expand Down
2 changes: 1 addition & 1 deletion private/buf/bufgen/bufgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const (
StrategyAll Strategy = 2
)

// Strategy is a generation stategy.
// Strategy is a generation strategy.
type Strategy int

// ParseStrategy parses the Strategy.
Expand Down
8 changes: 4 additions & 4 deletions private/buf/buflsp/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ func (s *server) Initialize(

// The LSP protocol library doesn't actually provide SemanticTokensOptions
// correctly.
type SematicTokensLegend struct {
type SemanticTokensLegend struct {
TokenTypes []string `json:"tokenTypes"`
TokenModifiers []string `json:"tokenModifiers"`
}
type SemanticTokensOptions struct {
protocol.WorkDoneProgressOptions

Legend SematicTokensLegend `json:"legend"`
Full bool `json:"full"`
Legend SemanticTokensLegend `json:"legend"`
Full bool `json:"full"`
}

return &protocol.InitializeResult{
Expand All @@ -125,7 +125,7 @@ func (s *server) Initialize(
HoverProvider: true,
SemanticTokensProvider: &SemanticTokensOptions{
WorkDoneProgressOptions: protocol.WorkDoneProgressOptions{WorkDoneProgress: true},
Legend: SematicTokensLegend{
Legend: SemanticTokensLegend{
TokenTypes: semanticTypeLegend,
TokenModifiers: semanticModifierLegend,
},
Expand Down
2 changes: 1 addition & 1 deletion private/buf/bufmigrate/bufmigrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type Migrator interface {
// regardless whether these module directories are specified in moduleDirPaths. Same
// behavior with multiple workspaces. For example, if workspace foo has directories
// bar and baz, then specifying foo, foo + bar and foo + bar + baz are the same.
// - If a workspace is specfied, and modules not from this workspace are specified, the
// - If a workspace is specified, and modules not from this workspace are specified, the
// buf.yaml will contain all directories from the workspace, as well as the module
// directories specified.
// - If only module directories are specified, then the buf.yaml will contain exactly
Expand Down
2 changes: 1 addition & 1 deletion private/buf/bufmigrate/migrate_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ func (m *migrateBuilder) addModule(ctx context.Context, moduleDirPath string) (r
}
bufYAMLFilePath := normalpath.Join(moduleDirPath, objectData.Name())
// If this module is already visited, we don't add it for a second time. It's
// possbile to visit the same module directory twice when the user specifies both
// possible to visit the same module directory twice when the user specifies both
// a workspace and a module in this workspace.
if _, ok := m.pathsToDelete[bufYAMLFilePath]; ok {
return nil
Expand Down
2 changes: 1 addition & 1 deletion private/buf/bufmigrate/migrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ func (m *migrator) buildBufYAMLAndBufLockFiles(
// If a declared dependency also shows up in the workspace, it's not a dependency.
//
// We are only removing lock entries that are in the workspace. A lock entry
// could be for an indirect dependenceny not listed in deps in any buf.yaml.
// could be for an indirect dependency not listed in deps in any buf.yaml.
if _, ok := migrateBuilder.moduleFullNameStringToParentPath[moduleFullName]; ok {
continue
}
Expand Down
4 changes: 2 additions & 2 deletions private/buf/buftarget/bucket_targeting.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ import (
// BucketTargeting provides targeting information for the bucket based on any controlling
// workspaces that have been found.
type BucketTargeting interface {
// ControllingWorkpsace returns the information for the controlling workspace, if one was
// ControllingWorkspace returns the information for the controlling workspace, if one was
// found. If not found, then this will be nil.
ControllingWorkspace() ControllingWorkspace
// SubDirPath returns the input directory relative to the controlling workspace, if one
// was found, otherwise it is relative to the root of the bucket
SubDirPath() string
// TargetPaths returns the target paths relative to the controlling workpsace, if one was
// TargetPaths returns the target paths relative to the controlling workspace, if one was
// found, otherwise it is relative to the root of the bucket.
TargetPaths() []string
// TargetExcludePaths returns the target exclude paths relative to the controlling
Expand Down
2 changes: 1 addition & 1 deletion private/buf/buftarget/terminate.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func TerminateAtControllingWorkspace(
}

// TerminateAtV1Module is a special terminate func that returns a controlling workspace with
// a v1 module confiugration if found at the given prefix.
// a v1 module configuration if found at the given prefix.
func TerminateAtV1Module(
ctx context.Context,
bucket storage.ReadBucket,
Expand Down
2 changes: 1 addition & 1 deletion private/buf/bufwkt/cmd/wkt-go-data/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ func getProtosourceFiles(
if err != nil {
var fileAnnotationSet bufanalysis.FileAnnotationSet
if errors.As(err, &fileAnnotationSet) {
// stderr since we do output to stdouot
// stderr since we do output to stdout
if err := bufanalysis.PrintFileAnnotationSet(
container.Stderr(),
fileAnnotationSet,
Expand Down
2 changes: 1 addition & 1 deletion private/buf/bufworkspace/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func WithTargetPaths(targetPaths []string, targetExcludePaths []string) Workspac
// If used with NewWorkspaceForModuleKey, this has no effect on the build,
// i.e. excludes are not respected, and the module name is ignored. This matches old behavior.
//
// This implements the deprected --config flag.
// This implements the deprecated --config flag.
//
// See bufconfig.GetBufYAMLFileForPrefixOrOverride for more details.
//
Expand Down
2 changes: 1 addition & 1 deletion private/buf/bufworkspace/workspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ type Workspace interface {
//
// However, this would mean that Workspace would not inherit ModuleSet, as we'd
// want to create GetWorkspaceModule.* functions instead of GetModule.* functions,
// and then provide a WorkpaceToModuleSet global function. This seems messier in
// and then provide a WorkspaceToModuleSet global function. This seems messier in
// practice than having users call GetLintConfigForOpaqueID(module.OpaqueID())
// in the situations where they need configuration.
GetLintConfigForOpaqueID(opaqueID string) bufconfig.LintConfig
Expand Down
2 changes: 1 addition & 1 deletion private/buf/bufworkspace/workspace_dep_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import (
type WorkspaceDepManager interface {
// BufLockFileDigestType returns the DigestType that the buf.lock file expects.
BufLockFileDigestType() bufmodule.DigestType
// ExisingBufLockFileDepModuleKeys returns the ModuleKeys from the buf.lock file.
// ExistingBufLockFileDepModuleKeys returns the ModuleKeys from the buf.lock file.
ExistingBufLockFileDepModuleKeys(ctx context.Context) ([]bufmodule.ModuleKey, error)
// ExistingBufLockFileRemotePluginKeys returns the PluginKeys from the buf.lock file.
ExistingBufLockFileRemotePluginKeys(ctx context.Context) ([]bufplugin.PluginKey, error)
Expand Down
2 changes: 1 addition & 1 deletion private/buf/bufworkspace/workspace_dep_manager_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type WorkspaceDepManagerProvider interface {
// If the underlying bucket has a v2 buf.yaml at the root, this builds a WorkspaceDepManager for this buf.yaml,
// using TargetSubDirPath for targeting.
//
// Otherwise, this builds a Workspace with a single module at the TargetSubDirPath (which may be "."), igoring buf.work.yamls.
// Otherwise, this builds a Workspace with a single module at the TargetSubDirPath (which may be "."), ignoring buf.work.yamls.
// Directories with buf.work.yamls cannot be directly targeted.

// Note this is the same logic as if WithIgnoreAndDisallowV1BufWorkYAMLs is applied with WorkspaceProvider!! If you want an equivalent
Expand Down
14 changes: 7 additions & 7 deletions private/buf/bufworkspace/workspace_targeting.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ func v2WorkspaceTargeting(
bufYAMLFile bufconfig.BufYAMLFile,
// If true and if a workspace module does not have a license/doc at its moduleDirPath,
// use the license/doc respectively at the workspace root for this module.
useWorkspaceLicenseDocIfNotFoundAtMoudle bool,
useWorkspaceLicenseDocIfNotFoundAtModule bool,
) (*workspaceTargeting, error) {
// We keep track of if any module was tentatively targeted, and then actually targeted via
// the paths flags. We use this pre-building of the ModuleSet to see if the --path and
Expand Down Expand Up @@ -231,7 +231,7 @@ func v2WorkspaceTargeting(
isTentativelyTargetModule := normalpath.EqualsOrContainsPath(bucketTargeting.SubDirPath(), moduleDirPath, normalpath.Relative)
// We ignore this check for proto file refs, since the input is considered the directory
// of the proto file reference, which is unlikely to contain a module in its entirety.
// In the future, it would be nice to handle this more elegently.
// In the future, it would be nice to handle this more elegantly.
if config.protoFileTargetPath != "" {
isTentativelyTargetModule = true
}
Expand All @@ -246,7 +246,7 @@ func v2WorkspaceTargeting(
moduleDirPath,
moduleConfig,
isTentativelyTargetModule,
useWorkspaceLicenseDocIfNotFoundAtMoudle,
useWorkspaceLicenseDocIfNotFoundAtModule,
)
if err != nil {
return nil, err
Expand Down Expand Up @@ -338,7 +338,7 @@ func v1WorkspaceTargeting(
isTentativelyTargetModule := normalpath.EqualsOrContainsPath(bucketTargeting.SubDirPath(), moduleDirPath, normalpath.Relative)
// We ignore this check for proto file refs, since the input is considered the directory
// of the proto file reference, which is unlikely to contain a module in its entirety.
// In the future, it would be nice to handle this more elegently.
// In the future, it would be nice to handle this more elegantly.
if config.protoFileTargetPath != "" {
isTentativelyTargetModule = true
}
Expand Down Expand Up @@ -569,7 +569,7 @@ func getMappedModuleBucketAndModuleTargeting(
isTargetModule bool,
// If true and if a workspace module does not have a license/doc at its moduleDirPath,
// use the license/doc respectively at the workspace root for this module.
useWorkspaceLicenseDocIfNotFoundAtMoudle bool,
useWorkspaceLicenseDocIfNotFoundAtModule bool,
) (storage.ReadBucket, *moduleTargeting, error) {
moduleBucket := storage.MapReadBucket(
workspaceBucket,
Expand Down Expand Up @@ -645,7 +645,7 @@ func getMappedModuleBucketAndModuleTargeting(
if err != nil {
return nil, nil, err
}
if useWorkspaceLicenseDocIfNotFoundAtMoudle {
if useWorkspaceLicenseDocIfNotFoundAtModule {
isModuleDocBucketEmpty, err := storage.IsEmpty(ctx, docStorageReadBucket, "")
if err != nil {
return nil, nil, err
Expand Down Expand Up @@ -838,7 +838,7 @@ func bucketIDsForModuleConfigsV2(moduleConfigs []bufconfig.ModuleConfig) []strin
// make sure each local module has a unique BucketID, which means we cannot use their DirPaths as
// BucketIDs directly. Instead, we append an index (1-indexed) to each DirPath to deduplicate, and
// each module's bucketID becomes "<path>[index]", except for the first one does not need the index
// and its bucketID is stil "<path>".
// and its bucketID is still "<path>".
// As an example, bucketIDs are shown for modules in the buf.yaml below:
// ...
// modules:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const (
privateVisibility = "private"
)

var allVisibiltyStrings = []string{
var allVisibilityStrings = []string{
publicVisibility,
privateVisibility,
}
Expand Down Expand Up @@ -122,7 +122,7 @@ func (f *flags) Bind(flagSet *pflag.FlagSet) {
&f.Visibility,
visibilityFlagName,
"",
fmt.Sprintf(`The plugin's visibility setting. Must be one of %s`, stringutil.SliceToString(allVisibiltyStrings)),
fmt.Sprintf(`The plugin's visibility setting. Must be one of %s`, stringutil.SliceToString(allVisibilityStrings)),
)
_ = appcmd.MarkFlagRequired(flagSet, visibilityFlagName)
}
Expand Down Expand Up @@ -536,7 +536,7 @@ func visibilityFlagToVisibility(visibility string) (registryv1alpha1.CuratedPlug
case privateVisibility:
return registryv1alpha1.CuratedPluginVisibility_CURATED_PLUGIN_VISIBILITY_PRIVATE, nil
default:
return 0, fmt.Errorf("invalid visibility: %s, expected one of %s", visibility, stringutil.SliceToString(allVisibiltyStrings))
return 0, fmt.Errorf("invalid visibility: %s, expected one of %s", visibility, stringutil.SliceToString(allVisibilityStrings))
}
}

Expand Down
2 changes: 1 addition & 1 deletion private/buf/cmd/buf/command/dep/internal/internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func Prune(
return workspaceDepManager.UpdateBufLockFile(ctx, depModuleKeys, existingRemotePluginKeys)
}

// LogUnusedConfiugredDepsForWorkspace takes a workspace and logs the unused configured
// LogUnusedConfiguredDepsForWorkspace takes a workspace and logs the unused configured
// dependencies as warnings to the user.
func LogUnusedConfiguredDepsForWorkspace(
workspace bufworkspace.Workspace,
Expand Down
2 changes: 1 addition & 1 deletion private/buf/cmd/buf/command/generate/generate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ func testRunStdoutStderr(t *testing.T, stdin io.Reader, expectedExitCode int, ex
appext.BuilderWithInterceptor(
// TODO FUTURE: use the real interceptor. Currently in buf.go, NewBuilder receives appflag.BuilderWithInterceptor(newErrorInterceptor()).
// However we cannot depend on newErrorInterceptor because it would create an import cycle, not to mention it needs to be exported first.
// This can depend on newErroInterceptor when it's moved to a separate package and made public.
// This can depend on newErrorInterceptor when it's moved to a separate package and made public.
func(next func(context.Context, appext.Container) error) func(context.Context, appext.Container) error {
return func(ctx context.Context, container appext.Container) error {
err := next(ctx, container)
Expand Down
Loading
Loading