Skip to content

Commit 2402521

Browse files
authored
Fix Godoc (#4080)
1 parent c6e0038 commit 2402521

File tree

17 files changed

+36
-2
lines changed

17 files changed

+36
-2
lines changed

.godoclint.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ enable:
5858
#- require-pkg-doc
5959
- specific-file-pkg-doc
6060
- start-with-name
61-
#- require-doc
61+
- require-doc
6262
- deprecated
6363
#- max-len
6464
- no-unused-link

make/go/dep_godoclint.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ $(call _assert_var,BUF_VERSION)
1212
#
1313
# Based off of dev branch.
1414
# https://github.com/bufbuild/godoc-lint/commits/dev
15-
GODOCLINT_VERSION ?= 5405ef06cd81f5b3115c6e52744f6cd9a8fa84f1a
15+
GODOCLINT_VERSION ?= 26c7b506fc2bf37a67fc2b42a3d9825c7ade2068
1616

1717
GODOCLINT := $(CACHE_VERSIONS)/godoclint/$(GODOCLINT_VERSION)
1818
$(GODOCLINT):

private/buf/bufcli/flags_args.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ import (
3030
)
3131

3232
const (
33+
// DefaultArchiveStatus is the default archive status.
34+
//
35+
// This is currently unarchived.
3336
DefaultArchiveStatus = unarchivedArchiveStatus
3437

3538
inputHashtagFlagName = "__hashtag__"

private/buf/bufctl/controller.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ type ImageWithConfig interface {
7171
isImageWithConfig()
7272
}
7373

74+
// Controller is the central entrypoint for the Buf CLI.
7475
type Controller interface {
7576
GetWorkspace(
7677
ctx context.Context,
@@ -156,6 +157,7 @@ type Controller interface {
156157
) (bufcheck.Client, error)
157158
}
158159

160+
// NewController returns a new Controller.
159161
func NewController(
160162
logger *slog.Logger,
161163
container app.EnvStdioContainer,

private/buf/bufctl/option.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,31 @@ import (
1818
"github.com/bufbuild/buf/private/buf/buffetch"
1919
)
2020

21+
// ControllerOption is a controller option.
2122
type ControllerOption func(*controller)
2223

24+
// WithDisableSymlinks returns a new ControllerOption that
2325
func WithDisableSymlinks(disableSymlinks bool) ControllerOption {
2426
return func(controller *controller) {
2527
controller.disableSymlinks = disableSymlinks
2628
}
2729
}
2830

31+
// WithFileAnnotationErrorFormat returns a new ControllerOption that sets the FileAnnotation format.
2932
func WithFileAnnotationErrorFormat(fileAnnotationErrorFormat string) ControllerOption {
3033
return func(controller *controller) {
3134
controller.fileAnnotationErrorFormat = fileAnnotationErrorFormat
3235
}
3336
}
3437

38+
// WithFileAnnotationsToStdout returns a new ControllerOption that sends FileAnnotations to stdout
3539
func WithFileAnnotationsToStdout() ControllerOption {
3640
return func(controller *controller) {
3741
controller.fileAnnotationsToStdout = true
3842
}
3943
}
4044

45+
// WithCopyToInMemory returns a new ControllerOption that copies to memory.
4146
func WithCopyToInMemory() ControllerOption {
4247
return func(controller *controller) {
4348
controller.copyToInMemory = true
@@ -49,37 +54,43 @@ func WithCopyToInMemory() ControllerOption {
4954
// TODO FUTURE: split up to per-function.
5055
type FunctionOption func(*functionOptions)
5156

57+
// WithTargetPaths returns a new FunctionOption that sets the target paths.
5258
func WithTargetPaths(targetPaths []string, targetExcludePaths []string) FunctionOption {
5359
return func(functionOptions *functionOptions) {
5460
functionOptions.targetPaths = targetPaths
5561
functionOptions.targetExcludePaths = targetExcludePaths
5662
}
5763
}
5864

65+
// WithImageExcludeSourceInfo returns a new FunctionOption that excludes source code info.
5966
func WithImageExcludeSourceInfo(imageExcludeSourceInfo bool) FunctionOption {
6067
return func(functionOptions *functionOptions) {
6168
functionOptions.imageExcludeSourceInfo = imageExcludeSourceInfo
6269
}
6370
}
6471

72+
// WithImageExcludeImports returns a new FunctionOption that excludes imports.
6573
func WithImageExcludeImports(imageExcludeImports bool) FunctionOption {
6674
return func(functionOptions *functionOptions) {
6775
functionOptions.imageExcludeImports = imageExcludeImports
6876
}
6977
}
7078

79+
// WithImageIncludeTypes returns a new FunctionOption that includes the given types.
7180
func WithImageIncludeTypes(imageTypes []string) FunctionOption {
7281
return func(functionOptions *functionOptions) {
7382
functionOptions.imageIncludeTypes = imageTypes
7483
}
7584
}
7685

86+
// WithImageExcludeTypes returns a new FunctionOption that excludes the given types.
7787
func WithImageExcludeTypes(imageExcludeTypes []string) FunctionOption {
7888
return func(functionOptions *functionOptions) {
7989
functionOptions.imageExcludeTypes = imageExcludeTypes
8090
}
8191
}
8292

93+
// WithImageAsFileDescriptorSet returns a new FunctionOption that returns the image as a FileDescriptorSet.
8394
func WithImageAsFileDescriptorSet(imageAsFileDescriptorSet bool) FunctionOption {
8495
return func(functionOptions *functionOptions) {
8596
functionOptions.imageAsFileDescriptorSet = imageAsFileDescriptorSet

private/buf/buffetch/internal/internal.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,7 @@ func WithGetReadWriteBucketTargetPaths(targetPaths []string) GetReadWriteBucketO
878878
}
879879
}
880880

881+
// WithGetReadWriteBucketTargetExcludePaths sets the target exclude paths.
881882
func WithGetReadWriteBucketTargetExcludePaths(targetExcludePaths []string) GetReadWriteBucketOption {
882883
return func(getReadWriteBucketOptions *getReadWriteBucketOptions) {
883884
getReadWriteBucketOptions.targetExcludePaths = targetExcludePaths

private/bufpkg/bufanalysis/bufanalysistesting/bufanalysistesting.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ func NewFileAnnotation(
8282
)
8383
}
8484

85+
// FileAnnotationOption is an option for a FileAnnotation.
8586
type FileAnnotationOption func(*fileAnnotationOptions)
8687

8788
// WithPluginName returns a FileAnnotationOption that sets the plugin name.

private/bufpkg/bufimage/bufimagemodify/internal/internal.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ type MarkSweeper interface {
2828
Sweep() error
2929
}
3030

31+
// NewMarkSweeper returns a new MarkSweeper.
3132
func NewMarkSweeper(image bufimage.Image) MarkSweeper {
3233
return newMarkSweeper(image)
3334
}

private/bufpkg/bufmodule/file_type.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,11 @@ import (
2323
)
2424

2525
const (
26+
// FileTypeProto is the file type for .proto files.
2627
FileTypeProto FileType = iota + 1
28+
// FileTypeDoc is the file type for documentation files.
2729
FileTypeDoc
30+
// FileTypeLicense is the file type for license files.
2831
FileTypeLicense
2932
)
3033

@@ -41,8 +44,10 @@ var (
4144
}
4245
)
4346

47+
// FileType is a tile type within a module.
4448
type FileType int
4549

50+
// String implements fmt.Stringer.
4651
func (c FileType) String() string {
4752
s, ok := fileTypeToString[c]
4853
if !ok {

private/bufpkg/bufmodule/object_data.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ type ObjectData interface {
3737
Data() []byte
3838
}
3939

40+
// NewObjectData returns a new ObjectData.
4041
func NewObjectData(name string, data []byte) (ObjectData, error) {
4142
return newObjectData(name, data)
4243
}

0 commit comments

Comments
 (0)