Skip to content

Commit 62416f0

Browse files
authored
Clean up godoc comments (#3613)
1 parent cc52cd6 commit 62416f0

File tree

48 files changed

+70
-72
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+70
-72
lines changed

private/buf/bufcli/cache.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ func newPluginDataProvider(
281281
if err != nil {
282282
return nil, err
283283
}
284-
delegateModuleDataProvider := bufpluginapi.NewPluingDataProvider(
284+
delegateModuleDataProvider := bufpluginapi.NewPluginDataProvider(
285285
container.Logger(),
286286
pluginClientProvider,
287287
)

private/buf/bufcli/flags_args.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ func BindArchiveStatus(flagSet *pflag.FlagSet, addr *string, flagName string) {
179179
)
180180
}
181181

182-
// Binds a string pointer flag, which indicates flag presence, i.e. `--flag ""` is not the same as not passing the flag.
182+
// BindStringPointer binds a string pointer flag, which indicates flag presence, i.e. `--flag ""` is not the same as not passing the flag.
183183
//
184184
// This is useful for buf registry organization/module update, where we only modify the fields specified.
185185
//

private/buf/buffetch/buffetch.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ var (
7171
//
7272
// This does not include deprecated formats.
7373
SourceOrModuleFormatsString = stringutil.SliceToString(sourceOrModuleFormatsNotDeprecated)
74-
// DirOrProtoFileFormats is the string representation of all dir or proto file formats.
74+
// DirOrProtoFileFormatsString is the string representation of all dir or proto file formats.
7575
//
7676
// This does not include deprecated formats.
7777
DirOrProtoFileFormatsString = stringutil.SliceToString(dirOrProtoFileFormats)
@@ -146,7 +146,7 @@ type ProtoFileRef interface {
146146
SourceRef
147147
DirOrProtoFileRef
148148
ProtoFilePath() string
149-
// True if the FileScheme is Stdio, Stdout, Stdin, or Null.
149+
// IsDevPath returns true if the FileScheme is Stdio, Stdout, Stdin, or Null.
150150
IsDevPath() bool
151151
IncludePackageFiles() bool
152152
internalProtoFileRef() internal.ProtoFileRef
@@ -167,7 +167,7 @@ type MessageRefParser interface {
167167
type SourceRefParser interface {
168168
// GetSourceRef gets the reference for the source file.
169169
GetSourceRef(ctx context.Context, value string) (SourceRef, error)
170-
// GetSourceRef gets the reference for the source file.
170+
// GetSourceRefForInputConfig gets the reference for the source file.
171171
GetSourceRefForInputConfig(
172172
ctx context.Context,
173173
inputConfig bufconfig.InputConfig,
@@ -233,8 +233,8 @@ type RefParser interface {
233233
DirRefParser
234234
SourceOrModuleRefParser
235235

236-
// TODO FUTURE: should this be renamed to GetRefForString?
237236
// GetRef gets the reference for the message file, source bucket, or module.
237+
// TODO FUTURE: should this be renamed to GetRefForString?
238238
GetRef(ctx context.Context, value string) (Ref, error)
239239
// GetRefForInputConfig gets the reference for the message file, source bucket, or module.
240240
GetRefForInputConfig(ctx context.Context, inputConfig bufconfig.InputConfig) (Ref, error)
@@ -328,7 +328,7 @@ type SourceReader interface {
328328
// GetReadBucketCloserOption is an option for a GetSourceReadBucketCloser call.
329329
type GetReadBucketCloserOption func(*getReadBucketCloserOptions)
330330

331-
// GetReadBucketCloserCopyToInMemory says to copy the returned ReadBucketCloser to an
331+
// GetReadBucketCloserWithCopyToInMemory says to copy the returned ReadBucketCloser to an
332332
// in-memory ReadBucketCloser. This can be a performance optimization at the expense of memory.
333333
func GetReadBucketCloserWithCopyToInMemory() GetReadBucketCloserOption {
334334
return func(getReadBucketCloserOptions *getReadBucketCloserOptions) {

private/buf/buffetch/internal/internal.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ type ProtoFileWriter interface {
511511
) (io.WriteCloser, error)
512512
}
513513

514-
// NewProtoWriter returns a new ProtoWriter.
514+
// NewProtoFileWriter returns a new ProtoFileWriter.
515515
func NewProtoFileWriter(
516516
logger *slog.Logger,
517517
) ProtoFileWriter {
@@ -820,7 +820,7 @@ func WithGetFileKeepFileCompression() GetFileOption {
820820
// GetReadBucketCloserOption is a GetReadBucketCloser option.
821821
type GetReadBucketCloserOption func(*getReadBucketCloserOptions)
822822

823-
// WithGetBucketCopyToInMemory says to copy the returned ReadBucketCloser to an
823+
// WithGetReadBucketCloserCopyToInMemory says to copy the returned ReadBucketCloser to an
824824
// in-memory ReadBucket. This can be a performance optimization at the expense of memory.
825825
func WithGetReadBucketCloserCopyToInMemory() GetReadBucketCloserOption {
826826
return func(getReadBucketCloserOptions *getReadBucketCloserOptions) {

private/buf/buflsp/file.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ func (f *file) Update(ctx context.Context, version int32, text string) {
175175
f.hasText = true
176176
}
177177

178-
// FetchSettings refreshes configuration settings for this file.
178+
// RefreshSettings refreshes configuration settings for this file.
179179
//
180180
// This only needs to happen when the file is open or when the client signals
181181
// that configuration settings have changed.

private/buf/buflsp/report.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func (r *report) Error(err reporter.ErrorWithPos) error {
3737
return nil
3838
}
3939

40-
// Error implements reporter.Handler for *diagnostics.
40+
// Warning implements reporter.Handler for *diagnostics.
4141
func (r *report) Warning(err reporter.ErrorWithPos) {
4242
r.diagnostics = append(r.diagnostics, newDiagnostic(err, true))
4343

private/buf/buflsp/server.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ func (s *server) DidOpen(
216216
return nil
217217
}
218218

219-
// DidOpen is called whenever the client opens a document. This is our signal to parse
219+
// DidChange is called whenever the client opens a document. This is our signal to parse
220220
// the file.
221221
func (s *server) DidChange(
222222
ctx context.Context,
@@ -320,8 +320,7 @@ func (s *server) Formatting(
320320
}, nil
321321
}
322322

323-
// DidOpen is called whenever the client opens a document. This is our signal to parse
324-
// the file.
323+
// DidClose is called whenever the client closes a document.
325324
func (s *server) DidClose(
326325
ctx context.Context,
327326
params *protocol.DidCloseTextDocumentParams,
@@ -332,7 +331,7 @@ func (s *server) DidClose(
332331

333332
// -- Language functionality methods.
334333

335-
// Definition is the entry point for hover inlays.
334+
// Hover is the entry point for hover inlays.
336335
func (s *server) Hover(
337336
ctx context.Context,
338337
params *protocol.HoverParams,

private/buf/buflsp/symbol.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ func (s *symbol) ReferencePath() (path []string, absolute bool) {
149149
return
150150
}
151151

152-
// Resolve attempts to resolve an unresolved reference across fileManager.
152+
// ResolveCrossFile attempts to resolve an unresolved reference across fileManager.
153153
func (s *symbol) ResolveCrossFile(ctx context.Context) {
154154
switch kind := s.kind.(type) {
155155
case *definition:

private/buf/bufworkspace/option.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ type WorkspaceModuleKeyOption interface {
2929
applyToWorkspaceModuleKeyConfig(*workspaceModuleKeyConfig)
3030
}
3131

32-
// WorkspaceOption is an option for a new Workspace created by either a Bucket or ModuleKey.
32+
// WorkspaceBucketAndModuleKeyOption is an option for a new Workspace created by either a Bucket or ModuleKey.
3333
type WorkspaceBucketAndModuleKeyOption interface {
3434
WorkspaceBucketOption
3535
WorkspaceModuleKeyOption
@@ -89,7 +89,7 @@ func WithTargetPaths(targetPaths []string, targetExcludePaths []string) Workspac
8989
// This flag will only work if no buf.work.yaml is detected, and the buf.yaml is a v1beta1
9090
// buf.yaml, v1 buf.yaml, or no buf.yaml. This flag will not work if a buf.work.yaml is
9191
// detected, or a v2 buf.yaml is detected.
92-
92+
//
9393
// If used with NewWorkspaceForModuleKey, this has no effect on the build,
9494
// i.e. excludes are not respected, and the module name is ignored. This matches old behavior.
9595
//

private/buf/bufworkspace/workspace_dep_manager_provider.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525

2626
// WorkspaceDepManagerProvider provides WorkspaceDepManagers.
2727
type WorkspaceDepManagerProvider interface {
28-
// GetWorkspaceDepManagerForBucket returns a new WorkspaceDepManager for the given Bucket.
28+
// GetWorkspaceDepManager returns a new WorkspaceDepManager for the given Bucket.
2929
//
3030
// If the workspace is not updateable, an error is returned.
3131
//
@@ -34,7 +34,7 @@ type WorkspaceDepManagerProvider interface {
3434
//
3535
// Otherwise, this builds a Workspace with a single module at the TargetSubDirPath (which may be "."), ignoring buf.work.yamls.
3636
// Directories with buf.work.yamls cannot be directly targeted.
37-
37+
//
3838
// Note this is the same logic as if WithIgnoreAndDisallowV1BufWorkYAMLs is applied with WorkspaceProvider!! If you want an equivalent
3939
// Workspace, you need to use this option!
4040
//

0 commit comments

Comments
 (0)