Skip to content

Commit

Permalink
Add custom lint and breaking change plugins (#3279)
Browse files Browse the repository at this point in the history
  • Loading branch information
bufdev authored Sep 4, 2024
1 parent da26542 commit 3075720
Show file tree
Hide file tree
Showing 846 changed files with 16,461 additions and 9,884 deletions.
10 changes: 9 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,15 @@ private/buf/cmd/buf/command/alpha/protoc/internal/protoc-gen-insertion-point-rec
private/buf/cmd/buf/command/alpha/protoc/internal/protoc-gen-insertion-point-writer/protoc-gen-insertion-point-writer
private/buf/cmd/buf/command/alpha/protoc/test.txt
private/buf/cmd/buf/command/generate/internal/protoc-gen-top-level-type-names-yaml/protoc-gen-top-level-type-names-yaml
private/buf/cmd/buf/testdata/imports/*/v3/modulelocks/
private/buf/cmd/buf/testdata/imports/cache/v3/modulelocks/
private/buf/cmd/buf/testdata/imports/corrupted_cache_dep/v3/modulelocks/
private/buf/cmd/buf/testdata/imports/corrupted_cache_file/v3/modulelocks/
private/bufpkg/bufcheck/internal/cmd/buf-plugin-duplicate-category/buf-plugin-duplicate-category
private/bufpkg/bufcheck/internal/cmd/buf-plugin-duplicate-rule/buf-plugin-duplicate-rule
private/bufpkg/bufcheck/internal/cmd/buf-plugin-panic/buf-plugin-panic
private/bufpkg/bufcheck/internal/cmd/buf-plugin-protovalidate-ext/buf-plugin-protovalidate-ext
private/bufpkg/bufcheck/internal/cmd/buf-plugin-rpc-ext/buf-plugin-rpc-ext
private/bufpkg/bufcheck/internal/cmd/buf-plugin-suffix/buf-plugin-suffix
private/bufpkg/bufmodule/bufmoduleapi/cmd/buf-legacyfederation-go-data/buf-legacyfederation-go-data
private/bufpkg/bufmodule/bufmoduletesting/cmd/buf-digest/buf-digest
private/bufpkg/bufmodule/bufmoduletesting/cmd/buf-new-commit-id/buf-new-commit-id
Expand Down
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,15 @@
/private/buf/cmd/buf/command/alpha/protoc/internal/protoc-gen-insertion-point-writer/protoc-gen-insertion-point-writer
/private/buf/cmd/buf/command/alpha/protoc/test.txt
/private/buf/cmd/buf/command/generate/internal/protoc-gen-top-level-type-names-yaml/protoc-gen-top-level-type-names-yaml
/private/buf/cmd/buf/testdata/imports/*/v3/modulelocks/
/private/buf/cmd/buf/testdata/imports/cache/v3/modulelocks/
/private/buf/cmd/buf/testdata/imports/corrupted_cache_dep/v3/modulelocks/
/private/buf/cmd/buf/testdata/imports/corrupted_cache_file/v3/modulelocks/
/private/bufpkg/bufcheck/internal/cmd/buf-plugin-duplicate-category/buf-plugin-duplicate-category
/private/bufpkg/bufcheck/internal/cmd/buf-plugin-duplicate-rule/buf-plugin-duplicate-rule
/private/bufpkg/bufcheck/internal/cmd/buf-plugin-panic/buf-plugin-panic
/private/bufpkg/bufcheck/internal/cmd/buf-plugin-protovalidate-ext/buf-plugin-protovalidate-ext
/private/bufpkg/bufcheck/internal/cmd/buf-plugin-rpc-ext/buf-plugin-rpc-ext
/private/bufpkg/bufcheck/internal/cmd/buf-plugin-suffix/buf-plugin-suffix
/private/bufpkg/bufmodule/bufmoduleapi/cmd/buf-legacyfederation-go-data/buf-legacyfederation-go-data
/private/bufpkg/bufmodule/bufmoduletesting/cmd/buf-digest/buf-digest
/private/bufpkg/bufmodule/bufmoduletesting/cmd/buf-new-commit-id/buf-new-commit-id
Expand Down
4 changes: 2 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,11 @@ issues:
- linters:
- staticcheck
text: "GetIgnoreEmpty is deprecated"
path: private/bufpkg/bufcheck/buflint/internal/buflintvalidate/field.go
path: private/bufpkg/bufcheck/bufcheckserver/internal/buflintvalidate/field.go
- linters:
- staticcheck
text: "GetSkipped is deprecated"
path: private/bufpkg/bufcheck/buflint/internal/buflintvalidate/field.go
path: private/bufpkg/bufcheck/bufcheckserver/internal/buflintvalidate/field.go
- linters:
- gochecknoinits
# we actually want to use init here
Expand Down
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@

## [Unreleased]

- No changes yet.
- Add concept of a default lint or breaking rule, which is printed out as a property when running
`buf config ls-{breaking,lint}-rules`. Default rules are those rules which are run if no lint
or breaking rules are explicitly configured in your `buf.yaml`.
- Rename `DEFAULT` lint rule category to `STANDARD`. With the concept of default rules being introduced,
having a category named `DEFAULT` is confusing, as while it happens that all the rules in the `DEFAULT`
lint category are also default rules, the name has become overloaded. As with all `buf` changes, this
change is backwards-compatible: the `DEFAULT` lint category continues to work, and always will. We
recommend changing to `STANDARD`, however.

## [v1.39.0] - 2024-08-27

Expand Down
39 changes: 22 additions & 17 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
module github.com/bufbuild/buf

go 1.21.0
go 1.22.0

toolchain go1.23.0

require (
buf.build/gen/go/bufbuild/bufplugin/protocolbuffers/go v1.34.2-20240904181154-a0be11449112.2
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.34.2-20240717164558-a6c49f84cc0f.2
buf.build/gen/go/bufbuild/registry/connectrpc/go v1.16.2-20240821192916-45ba72cdd479.1
buf.build/gen/go/bufbuild/registry/protocolbuffers/go v1.34.2-20240821192916-45ba72cdd479.2
connectrpc.com/connect v1.16.2
connectrpc.com/otelconnect v0.7.1
github.com/bufbuild/protocompile v0.14.0
github.com/bufbuild/bufplugin-go v0.1.0
github.com/bufbuild/protocompile v0.14.1
github.com/bufbuild/protoplugin v0.0.0-20240323223605-e2735f6c31ee
github.com/bufbuild/protovalidate-go v0.6.5
github.com/bufbuild/protoyaml-go v0.1.12
Expand Down Expand Up @@ -40,22 +42,24 @@ require (
go.uber.org/zap v1.27.0
golang.org/x/crypto v0.26.0
golang.org/x/exp v0.0.0-20240823005443-9b4947da3948
golang.org/x/mod v0.20.0
golang.org/x/mod v0.21.0
golang.org/x/net v0.28.0
golang.org/x/sync v0.8.0
golang.org/x/term v0.23.0
golang.org/x/term v0.24.0
golang.org/x/tools v0.24.0
google.golang.org/protobuf v1.34.2
google.golang.org/protobuf v1.34.3-0.20240816073751-94ecbc261689

This comment has been minimized.

Copy link
@NathanBaulch

NathanBaulch Sep 15, 2024

Switching to the unreleased "devel" version here, was this intentional?

gopkg.in/yaml.v3 v3.0.1
pluginrpc.com/pluginrpc v0.2.0
)

require (
buf.build/gen/go/pluginrpc/pluginrpc/protocolbuffers/go v1.34.2-20240828222655-5345c0a56177.2 // indirect
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/Microsoft/hcsshim v0.12.6 // indirect
github.com/antlr4-go/antlr/v4 v4.13.0 // indirect
github.com/antlr4-go/antlr/v4 v4.13.1 // indirect
github.com/containerd/cgroups/v3 v3.0.3 // indirect
github.com/containerd/containerd v1.7.20 // indirect
github.com/containerd/containerd v1.7.21 // indirect
github.com/containerd/continuity v0.4.3 // indirect
github.com/containerd/errdefs v0.1.0 // indirect
github.com/containerd/log v0.1.0 // indirect
Expand All @@ -66,22 +70,23 @@ require (
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/cli v27.1.2+incompatible // indirect
github.com/docker/cli v27.2.0+incompatible // indirect
github.com/docker/distribution v2.8.3+incompatible // indirect
github.com/docker/docker-credential-helpers v0.8.2 // indirect
github.com/docker/go-connections v0.5.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/felixge/fgprof v0.9.4 // indirect
github.com/felixge/fgprof v0.9.5 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 // indirect
github.com/google/pprof v0.0.0-20240903155634-a8630aee4ab9 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/moby/locker v1.0.1 // indirect
Expand All @@ -93,13 +98,13 @@ require (
github.com/moby/sys/userns v0.1.0 // indirect
github.com/moby/term v0.5.0 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/onsi/ginkgo/v2 v2.20.1 // indirect
github.com/onsi/ginkgo/v2 v2.20.2 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0 // indirect
github.com/opencontainers/runtime-spec v1.2.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/quic-go/qpack v0.4.0 // indirect
github.com/quic-go/qpack v0.5.0 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
Expand All @@ -109,9 +114,9 @@ require (
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect
go.opentelemetry.io/otel/metric v1.29.0 // indirect
go.uber.org/mock v0.4.0 // indirect
golang.org/x/sys v0.24.0 // indirect
golang.org/x/text v0.17.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240823204242-4ba0660f739c // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240823204242-4ba0660f739c // indirect
google.golang.org/grpc v1.65.0 // indirect
golang.org/x/sys v0.25.0 // indirect
golang.org/x/text v0.18.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect
google.golang.org/grpc v1.66.0 // indirect
)
Loading

0 comments on commit 3075720

Please sign in to comment.