Skip to content

Commit 4feeb0b

Browse files
Merge branch 'main' into svanburen/lsp-edition-2024
2 parents e672ab5 + 4696ee0 commit 4feeb0b

File tree

170 files changed

+6704
-747
lines changed

Some content is hidden

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

170 files changed

+6704
-747
lines changed

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@
99
**/corpus/** linguist-generated=true
1010
**/usage.gen.go linguist-generated=true
1111
/private/gen/** linguist-generated=true
12+
13+
# Use union merge for CHANGELOG to avoid conflicts when multiple branches
14+
# add entries under [Unreleased]
15+
CHANGELOG.md merge=union

.github/workflows/back-to-development.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Get GitHub app token
13-
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0
13+
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
1414
id: app_token
1515
with:
1616
app-id: ${{ env.APP_ID }}

.github/workflows/build-and-draft-release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
VERSION="${{ github.event.inputs.version || github.head_ref}}"
2121
echo "VERSION=${VERSION##*/v}" >> $GITHUB_ENV
2222
- name: Get GitHub app token
23-
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0
23+
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
2424
id: app_token
2525
with:
2626
app-id: ${{ env.APP_ID }}

.github/workflows/create-release-pr.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Get GitHub app token
15-
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0
15+
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
1616
id: app_token
1717
with:
1818
app-id: ${{ env.APP_ID }}

.github/workflows/make-upgrade.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Get GitHub app token
13-
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0
13+
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
1414
id: app_token
1515
with:
1616
app-id: ${{ env.APP_ID }}

.golangci.yml

Lines changed: 71 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ linters:
5151
forbid:
5252
# Use private/pkg/thread.Parallelize
5353
- pattern: ^errgroup\.
54-
# Use private/pkg/standard/xos/xexec
54+
# Use buf.build/go/standard/xos/xexec
5555
- pattern: ^exec\.Cmd$
5656
- pattern: ^exec\.Command$
5757
- pattern: ^exec\.CommandContext$
@@ -132,11 +132,6 @@ linters:
132132
# This is a legacy usage of os.Getwd we're not bothering to port yet.
133133
path: cmd/buf/internal/command/alpha/protoc/protoc_test.go
134134
text: os.Getwd
135-
- linters:
136-
- dogsled
137-
# One function call doesn't care about most of the returned destructured values. The
138-
# dogsled linter complains about it. (Value of this linter is unclear...)
139-
path: cmd/buf/internal/command/curl/curl.go
140135
- linters:
141136
- forbidigo
142137
# This is a legacy usage of os.Getwd we're not bothering to port yet.
@@ -153,11 +148,6 @@ linters:
153148
# trip this off.
154149
path: private/buf/bufcli/env.go
155150
text: "G101:"
156-
- linters:
157-
- gosec
158-
# G404 checks for use of the ordinary non-CPRNG.
159-
path: private/buf/buflsp/progress.go
160-
text: "G404:"
161151
- linters:
162152
- gosec
163153
# G115 checks for use of truncating conversions.
@@ -173,11 +163,6 @@ linters:
173163
# G115 checks for use of truncating conversions.
174164
path: private/buf/buflsp/image.go
175165
text: "G115:"
176-
- linters:
177-
- gosec
178-
# G115 checks for use of truncating conversions.
179-
path: private/buf/buflsp/report.go
180-
text: "G115:"
181166
- linters:
182167
- gosec
183168
# G115 checks for use of truncating conversions.
@@ -213,6 +198,16 @@ linters:
213198
# G115 checks for use of truncating conversions.
214199
path: private/buf/buflsp/organize_imports.go
215200
text: "G115:"
201+
- linters:
202+
- gosec
203+
# G115 checks for use of truncating conversions.
204+
path: private/buf/buflsp/buf_yaml.go
205+
text: "G115:"
206+
- linters:
207+
- gosec
208+
# G115 checks for use of truncating conversions.
209+
path: private/buf/buflsp/buf_yaml_hover.go
210+
text: "G115:"
216211
- linters:
217212
- containedctx
218213
# Type must implement an interface whose methods do not accept context. But this
@@ -224,6 +219,11 @@ linters:
224219
# We verify manually so that we can emit verbose output while doing so.
225220
path: private/buf/bufcurl/tls.go
226221
text: "G402:"
222+
- linters:
223+
- gosec
224+
# InsecureSkipVerify mirrors the value of the --insecure flag chosen by the user.
225+
path: cmd/buf/internal/command/curl/curl.go
226+
text: "G402:"
227227
- linters:
228228
- paralleltest
229229
# This test shouldn't run in parallel as it needs osext.Getwd.
@@ -262,43 +262,16 @@ linters:
262262
- containedctx
263263
# we actually want to embed a context here
264264
path: private/bufpkg/bufmodule/module_set_builder.go
265-
- linters:
266-
- containedctx
267-
# we actually want to embed a context here
268-
path: private/pkg/standard/xos/xexec/process.go
269265
- linters:
270266
- gochecknoinits
271267
# we actually want to use init here
272268
path: private/bufpkg/bufmodule/paths.go
273-
- linters:
274-
- forbidigo
275-
# we want to use errgroup here
276-
path: private/bufpkg/bufremoteplugin/bufremoteplugindocker/docker.go
277-
text: use of `errgroup
278-
- linters:
279-
- forbidigo
280-
# this is one of two files we want to allow exec.Cmd functions in
281-
path: private/pkg/standard/xos/xexec/xexec.go
282-
- linters:
283-
- forbidigo
284-
# this is one of two files we want to allow exec.Cmd functions in
285-
path: private/pkg/standard/xos/xexec/process.go
286-
- linters:
287-
- gosec
288-
# G204 checks that exec.Command is not called with non-constants.
289-
path: private/pkg/standard/xos/xexec/xexec.go
290-
text: "G204:"
291269
- linters:
292270
- gosec
293271
# We should be able to use net/http/cgi in a unit test, in addition the CVE mentions
294272
# only versions of go < 1.6.3 are affected.
295273
path: private/pkg/git/git_test.go
296274
text: "G504:"
297-
- linters:
298-
- wastedassign
299-
# netrc/internal is a library largely copied in from an external repository with attribution.
300-
# We try to make minimal edits.
301-
path: private/pkg/netrc/internal/internal.go
302275
- linters:
303276
- forbidigo
304277
# We cache os.Getwd in osext, osext is the entrypoint.
@@ -309,23 +282,11 @@ linters:
309282
# We cache os.Getwd in osext, osext has a Chdir that clears the cache.
310283
path: private/pkg/osext/osext.go
311284
text: os.Chdir
312-
- linters:
313-
- forbidigo
314-
# We're going to move xfilepath out.
315-
path: private/pkg/standard/xpath/xfilepath/xfilepath.go
316-
text: os.Getwd
317285
- linters:
318286
- gochecknoinits
319287
# protoencoding calls detrand.Disable via go:linkname and and init function. See the comments
320288
# in the file for more details.
321289
path: private/pkg/protoencoding/detrand.go
322-
- linters:
323-
- errcheck
324-
# headers.go has casts with values from contexts that should fail if there
325-
# is no error, but it would be very unidiomatic to return an error from
326-
# the functions that do these casts, and we completely control the
327-
# context values within this file
328-
path: private/pkg/rpc/headers.go
329290
- linters:
330291
- forbidigo
331292
# we use os.Rename here to rename files in the same directory
@@ -337,37 +298,18 @@ linters:
337298
# connCtx is cancelled when the connection is done; the context lifetime is
338299
# tied to the struct, not passed per-call.
339300
path: private/buf/buflsp/buflsp.go
340-
- linters:
341-
- containedctx
342-
# we actually want to embed a context here
343-
path: private/pkg/transport/grpc/grpcclient/client_conn_provider.go
344301
- linters:
345302
- forbidigo
346303
# we actually want to use errgroup when starting an HTTP server
347304
path: private/pkg/transport/http/httpserver/httpserver.go
348305
- linters:
349306
- staticcheck
350307
text: "ST1005:"
351-
- linters:
352-
- gochecknoinits
353-
# we actually want to use this init
354-
path: private/usage/usage.go
355-
- linters:
356-
- staticcheck
357-
# We deprecated all the definitions in plugin.proto but we still implement them.
358-
text: buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated
359-
- linters:
360-
- staticcheck
361-
# We deprecated all the definitions in generate.proto but we still implement them.
362-
text: buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated
363308
- linters:
364309
- staticcheck
365310
# This greatly simplifies creation of descriptors, and it's safe enough since
366311
# it's just test code.
367312
text: GetDeprecatedLegacyJsonFieldConflicts is deprecated
368-
- linters:
369-
- forcetypeassert
370-
path: private/bufpkg/bufimage/source_retention_options_test\.go
371313
- linters:
372314
- paralleltest
373315
# The LsModules tests call chdir and cannot be parallelized.
@@ -476,18 +418,67 @@ linters:
476418
# to set the source path for the location, this operation should be safe.
477419
path: private/bufpkg/bufcheck/bufcheckserver/internal/buflintvalidate/predefined_rules.go
478420
text: "G115:"
479-
- linters:
480-
- govet
481-
# We print command.Short to markdown, which is controlled and set by each command
482-
# and should be considered safe.
483-
path: private/bufpkg/bufcobra/markdown.go
484-
text: "printf: non-constant format string in call to p"
485421
- linters:
486422
- gosec
487423
# This converts slice indexes in a FileDescriptorProto to int32,
488424
# which are not an actual risk of overflow.
489425
path: private/bufpkg/bufimage/bufimageutil/image_filter.go
490426
text: "G115:"
427+
- linters:
428+
- gosec
429+
# G115: int32->uint32 reinterpretation (same width, no data loss) passed
430+
# to binary.LittleEndian.PutUint32 to encode protobuf source path elements
431+
# as a byte-string map key. gosec flags same-width signed->unsigned casts.
432+
path: private/bufpkg/bufimage/bufimagemodify/internal/marksweeper.go
433+
text: "G115:"
434+
- linters:
435+
- gosec
436+
# G115: same int32->uint32 reinterpretation as marksweeper.go above.
437+
path: private/bufpkg/bufprotosource/location_store.go
438+
text: "G115:"
439+
- linters:
440+
- gosec
441+
# G115: uintptr->int conversion for passing a terminal file descriptor
442+
# to term.IsTerminal/term.ReadPassword, which require int. Safe on all
443+
# supported platforms; fd values fit in int.
444+
path: private/buf/bufcli/prompt.go
445+
text: "G115:"
446+
- linters:
447+
- gosec
448+
# G115: uintptr->int conversion to pass a writer's file descriptor to
449+
# term.IsTerminal. Safe on all supported platforms.
450+
path: private/pkg/slogapp/console.go
451+
text: "G115:"
452+
- linters:
453+
- gosec
454+
# G602: false positive — the loop index i is bounded by the length of
455+
# both slices, which are verified equal before the loop.
456+
path: private/bufpkg/bufimage/build_image_test.go
457+
text: "G602:"
458+
- linters:
459+
- gosec
460+
# G602: false positive — the loop index i is bounded by the length of
461+
# both slices, which are verified equal before the loop.
462+
path: private/pkg/slogapp/console_test.go
463+
text: "G602:"
464+
- linters:
465+
- gosec
466+
# G117: the Password field is intentionally marshaled — this struct
467+
# exists specifically to encode Docker registry credentials for the
468+
# X-Registry-Auth header.
469+
path: private/bufpkg/bufremoteplugin/bufremoteplugindocker/registry_auth_config.go
470+
text: "G117:"
471+
- linters:
472+
- gosec
473+
# G117: test for registry_auth_config.go; same reasoning as above.
474+
path: private/bufpkg/bufremoteplugin/bufremoteplugindocker/registry_auth_config_test.go
475+
text: "G117:"
476+
- linters:
477+
- gosec
478+
# G703: the filename comes from walking the filesystem with os.Stat,
479+
# not from user input, so path traversal is not a realistic risk here.
480+
path: private/pkg/licenseheader/cmd/license-header/main.go
481+
text: "G703:"
491482

492483
issues:
493484
max-same-issues: 0

CHANGELOG.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,24 @@
22

33
## [Unreleased]
44

5+
- Add LSP document links for `buf.yaml` dep entries, making each dependency a clickable link to its BSR module page.
6+
- Add LSP code lenses for `buf.yaml` files to update all dependencies (`buf.dep.updateAll`) or check for available updates (`buf.dep.checkUpdates`).
7+
- Improve shell completions for `buf` flags with fixed value sets and file/directory arguments.
8+
- Add `buf curl` URL path shell completions (service and method names) via
9+
server reflection, `--schema`, or the local buf module.
10+
- Add support for Edition 2024 syntax to `buf format`.
11+
- Fix `buf generate --clean` deleting files from nested plugin output directories.
12+
13+
## [v1.67.0] - 2026-04-01
14+
15+
- Fix LSP not skipping `buf.build/docs` links for lint rules from check plugins and policies.
16+
- Fix `buf dep graph --format json` silently dropping dependencies when a dependency was already seen.
517
- Add support for `--rbs_out` as a `protoc_builtin` plugin (requires protoc v34.0+).
618
- Add relevant links from CEL LSP hover documentation to either <celbyexample.com> or <protovalidate.com>
19+
- Add OpenBSD and FreeBSD release binaries for amd64 and arm64.
720
- Skip writing unchanged output files in `buf generate` to preserve modification times
21+
- Update `buf beta registry plugin delete` to prompt the user for deletion, matching the UX of the other deletion commands.
22+
Use `--force` to restore the old behavior.
823

924
## [v1.66.1] - 2026-03-09
1025

@@ -1502,7 +1517,8 @@ buf check breaking proto --against .git#branch=master,subdir=proto
15021517

15031518
Initial beta release.
15041519

1505-
[Unreleased]: https://github.com/bufbuild/buf/compare/v1.66.1...HEAD
1520+
[Unreleased]: https://github.com/bufbuild/buf/compare/v1.67.0...HEAD
1521+
[v1.67.0]: https://github.com/bufbuild/buf/compare/v1.66.1...v1.67.0
15061522
[v1.66.1]: https://github.com/bufbuild/buf/compare/v1.66.0...v1.66.1
15071523
[v1.66.0]: https://github.com/bufbuild/buf/compare/v1.65.0...v1.66.0
15081524
[v1.65.0]: https://github.com/bufbuild/buf/compare/v1.64.0...v1.65.0

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![The Buf logo](./.github/buf-logo.svg)
1+
![The Buf logo](https://raw.githubusercontent.com/bufbuild/buf/main/.github/buf-logo.svg)
22

33
# Buf
44

@@ -102,14 +102,14 @@ After completing the tour, check out the remainder of the [docs] for your specif
102102

103103
The following is a breakdown of the binaries by CPU architecture and operating system available through our [releases]:
104104

105-
| | Linux | MacOS | Windows |
106-
| --- | --- | --- | --- |
107-
| x86 (64-bit) ||||
108-
| ARM (64-bit) ||||
109-
| ARMv7 (32-bit) ||||
110-
| RISC-V (64-bit) ||||
111-
| ppc64le ||||
112-
| s390x ||||
105+
| | Linux | MacOS | Windows | OpenBSD | FreeBSD |
106+
| --- | --- | --- | --- | --- | --- |
107+
| x86 (64-bit) ||||||
108+
| ARM (64-bit) ||||||
109+
| ARMv7 (32-bit) ||||||
110+
| RISC-V (64-bit) ||||||
111+
| ppc64le ||||||
112+
| s390x ||||||
113113

114114
## Community
115115

cmd/buf/buf.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,14 @@ func newRootCommand(name string) *appcmd.Command {
462462
},
463463
ModifyCobra: func(cobraCommand *cobra.Command) error {
464464
cobraCommand.AddCommand(bufcobra.NewWebpagesCommand("webpages", cobraCommand))
465-
return nil
465+
return cobraCommand.RegisterFlagCompletionFunc(
466+
"log-format",
467+
cobra.FixedCompletions([]string{
468+
appext.LogFormatText.String(),
469+
appext.LogFormatColor.String(),
470+
appext.LogFormatJSON.String(),
471+
}, cobra.ShellCompDirectiveNoFileComp|cobra.ShellCompDirectiveKeepOrder),
472+
)
466473
},
467474
}
468475
}

cmd/buf/internal/command/alpha/protoc/protoc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ func run(
219219
return err
220220
}
221221
}
222-
if err := responseWriter.Close(); err != nil {
222+
if err := responseWriter.Close(ctx); err != nil {
223223
return err
224224
}
225225
return nil

0 commit comments

Comments
 (0)