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.19k stars 378 forks source link

Support MODULE.bazel test cases for gazelle_generation_test. #1948

Closed gonzojive closed 1 week ago

gonzojive commented 1 week ago

What type of PR is this?

Feature (testing enhancement for extension developers)

What package or component does this PR mostly affect?

gazelle_generation_test

What does this PR do? Why is it needed?

gazelle_generation_test uses the existence of a WORKSPACE file to indicate a directory is a test case. This PR extends gazelle_generation_test to also look for directories with a MODULE.bazel file.

A test case is modified to check the logic.

Which issues(s) does this PR fix?

Fixes # 1947

Other notes for review

Added as part of kotlin gazelle development.