forked from bufbuild/buf
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix support for unused imports linting in protoc-gen-buf-lint (bufbui…
…ld#1835) This will address bufbuild/rules_buf#32. The problem is that the code generator request does not include the stored unused dependencies. So, since the check doesn't see that information, it never complains (even if the file does have unused imports, and the compiler that originally produced the descriptor set warned about them). So, just for `protoc-gen-buf-lint`, we introduce a new step to re-compute the unused dependencies and store them in the image proto. This is woven into `bufimage`, because that's the place where we have the information needed to do this. This basically emulates the checks that the compiler does. The compiler populates the set of used imports while resolving all symbols in the file, during linking. So we basically do that, too, by visiting all references and marking associated imports as used.
- Loading branch information
Showing
31 changed files
with
736 additions
and
214 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.