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

perf: preload .bazelignore before configure, do not use globs #1886

Closed jbedard closed 1 month ago

jbedard commented 1 month ago

The .bazelignore should be loaded once upfront and not depend on the config.Configurer invocation order.

.bazelignore does not support globs like the gazelle excludes so a simple map lookup instead of glob evaluation is enough and faster.

Do not invoke config.Configure on a directory which is .bazelignored, unlike excludes which only applies to sub-directories within a BUILD.

What type of PR is this? Other

What package or component does this PR mostly affect? all

What does this PR do? Why is it needed?

Cleanup