GithubHelp home page GithubHelp logo

lint ignore not working about buf HOT 4 CLOSED

bufbuild avatar bufbuild commented on May 17, 2024
lint ignore not working

from buf.

Comments (4)

bufdev avatar bufdev commented on May 17, 2024

This isn't a bug - you have duplicate types.

https://github.com/xmlking/micro-starter-kit/blob/develop/srv/account/proto/profile/profile_service.proto
https://github.com/xmlking/micro-starter-kit/blob/develop/e2e/profile_service.bloomrpc.proto

Both contain the same types, for example micro.account.profile.v1.ProfileService. This would fail with protoc as well:

$ git remote -v
origin	https://github.com/xmlking/micro-starter-kit (fetch)
origin	https://github.com/xmlking/micro-starter-kit (push)
$ protoc -I . -o /dev/null $(find . -name *.proto)
srv/account/proto/profile/profile_service.proto:24:31: "micro.account.profile.v1.ListRequest.limit" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:26:31: "micro.account.profile.v1.ListRequest.page" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:27:31: "micro.account.profile.v1.ListRequest.sort" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:28:31: "micro.account.profile.v1.ListRequest.preferred_theme" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:31:48: "micro.account.profile.v1.ListRequest.gender" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:23:9: "micro.account.profile.v1.ListRequest" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:37:46: "micro.account.profile.v1.ListResponse.results" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:38:10: "micro.account.profile.v1.ListResponse.total" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:35:9: "micro.account.profile.v1.ListResponse" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto: "micro.account.profile.v1.GetRequest.id" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:43:33: "micro.account.profile.v1.GetRequest.profile_id" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:45:33: "micro.account.profile.v1.GetRequest.user_id" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:41:9: "micro.account.profile.v1.GetRequest" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:52:37: "micro.account.profile.v1.GetResponse.result" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:50:9: "micro.account.profile.v1.GetResponse" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:56:31: "micro.account.profile.v1.CreateRequest.user_id" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:58:31: "micro.account.profile.v1.CreateRequest.tz" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:59:31: "micro.account.profile.v1.CreateRequest.avatar" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:61:48: "micro.account.profile.v1.CreateRequest.gender" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:63:29: "micro.account.profile.v1.CreateRequest.birthday" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:65:31: "micro.account.profile.v1.CreateRequest.preferred_theme" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:55:9: "micro.account.profile.v1.CreateRequest" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:72:37: "micro.account.profile.v1.CreateResponse.result" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:70:9: "micro.account.profile.v1.CreateResponse" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:16:7: "micro.account.profile.v1.ProfileService.List" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:17:7: "micro.account.profile.v1.ProfileService.Get" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:18:7: "micro.account.profile.v1.ProfileService.Create" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:15:9: "micro.account.profile.v1.ProfileService" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:16:12: "micro.account.profile.v1.ListRequest" seems to be defined in "e2e/profile_service.bloomrpc.proto", which is not imported by "srv/account/proto/profile/profile_service.proto".  To use it here, please add the necessary import.
srv/account/proto/profile/profile_service.proto:16:34: "micro.account.profile.v1.ListResponse" seems to be defined in "e2e/profile_service.bloomrpc.proto", which is not imported by "srv/account/proto/profile/profile_service.proto".  To use it here, please add the necessary import.
srv/account/proto/profile/profile_service.proto:17:11: "micro.account.profile.v1.GetRequest" seems to be defined in "e2e/profile_service.bloomrpc.proto", which is not imported by "srv/account/proto/profile/profile_service.proto".  To use it here, please add the necessary import.
srv/account/proto/profile/profile_service.proto:17:32: "micro.account.profile.v1.GetResponse" seems to be defined in "e2e/profile_service.bloomrpc.proto", which is not imported by "srv/account/proto/profile/profile_service.proto".  To use it here, please add the necessary import.
srv/account/proto/profile/profile_service.proto:18:14: "micro.account.profile.v1.CreateRequest" seems to be defined in "e2e/profile_service.bloomrpc.proto", which is not imported by "srv/account/proto/profile/profile_service.proto".  To use it here, please add the necessary import.
srv/account/proto/profile/profile_service.proto:18:38: "micro.account.profile.v1.CreateResponse" seems to be defined in "e2e/profile_service.bloomrpc.proto", which is not imported by "srv/account/proto/profile/profile_service.proto".  To use it here, please add the necessary import.
srv/account/proto/profile/profile_service.proto:13:1: warning: Import third_party/proto/validate/validate.proto is unused.

from buf.

bufdev avatar bufdev commented on May 17, 2024

Not directly related to your issue, but also see https://buf.build/docs/build-configuration#root-requirements.

The general issue is you can't have a type defined in two places as part of your build - this is a general Protobuf requirement, not just a Buf requirement (and is also a requirement in most languages). There's some issue above where you have nearly the same file in two places.

Closing this issue unless there's something else. Let us know!

from buf.

xmlking avatar xmlking commented on May 17, 2024

@bufdev thanks for clarifying. I had e2e/profile_service.bloomrpc.proto for documentation purpose only.

bloomrpc tool cannot load .proto files with certain validation rules. so I have to share slightly modified profile_service.bloomrpc.proto in my repo.

I am building my protos with Makefile

		for f in ${TYPE}/${TARGET}/proto/**/*.proto; do \
			protoc --proto_path=.:${GOPATH}/src \
			--go_out=paths=source_relative:. \
			--micro_out=paths=source_relative:. \
			--gorm_out=engine=postgres,enums=string,paths=source_relative:. \
			--validate_out=lang=go,paths=source_relative:. $$f; \
			echo ✓ compiled: $$f; \
		done \

is it possible to make Buf truly ** exclude** some files from BUILD and LINT if I give . as root?
it is common to have some duplicate photo files in docs or dist folders

from buf.

bufdev avatar bufdev commented on May 17, 2024

Yes, see https://buf.build/docs/build-configuration#excludes

from buf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.