bazel-contrib / bazel-gazelle

Gazelle is a Bazel build file generator for Bazel projects. It natively supports Go and protobuf, and it may be extended to support new languages and custom rule sets.
Apache License 2.0
1.2k stars 380 forks source link

fail if any import statements are unrecognised #622

Closed asuffield closed 5 years ago

asuffield commented 5 years ago

It is regularly confusing to users when they run gazelle and it completes successfully, then the build fails because some import statement was not recognised and gazelle responded by just not including this dependency in the BUILD file. This is extra-double-confusing when the bug is a subtle misspelling in the import statement in the go code, because the error from bazel will be the mangled name, and you have to unmangle it to spot the mistake.

Please have a "strict" mode for gazelle which fails instantly if it sees an unrecognised import statement. I don't always want this for go_repository rules, but I do always want it for go code that I wrote.

jayconrod commented 5 years ago

Duplicate of #499