Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buf lint should not require proto files to import (or build) #309

Closed
hojongs opened this issue Apr 20, 2021 · 3 comments
Closed

buf lint should not require proto files to import (or build) #309

hojongs opened this issue Apr 20, 2021 · 3 comments

Comments

@hojongs
Copy link

hojongs commented Apr 20, 2021

I ran buf lint command with my proto files, there are no some proto files to import because lint doesn't check whether import proto file exists or not.

For example,

# my input files for buf lint
b.proto # in this file, I'll assume it imports a.proto file. but I'll run lint without a.proto file.

When I run buf lint, I got this output message. I can't lint b.proto file without a.proto file.

b.proto:7:8:a.proto: does not exist

lint is not build task so lint should not require proto files to build protobuf.

@bufdev
Copy link
Member

bufdev commented Apr 20, 2021

Lint does require you to build in our case - if we don't know if your files are valid Protobuf, we can't lint them. Many linters for other languages do away with this by just parsing the AST, but there are situations in Protobuf where we wouldn't be able to determine whether a given linter passes without knowing that a build is valid.

@bufdev bufdev closed this as completed Apr 20, 2021
@DarthPestilane
Copy link

I run into the same, how can I fix this?

@hojongs
Copy link
Author

hojongs commented Mar 31, 2022

As the comment above, buf lint requires build protobuf.
So I just made proto files able to build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants