@@ -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
492483issues :
493484 max-same-issues : 0
0 commit comments