bazel-gazelle icon indicating copy to clipboard operation
bazel-gazelle copied to clipboard

Exclude files/folders that are .gitignore'd

Open alexeagle opened this issue 2 years ago • 2 comments

This is a major usability hurdle at one of Aspect's clients. Gazelle fails because they have some junk in their repo which is covered by a .gitignore so they don't realize they have an unclean state. The error messages when gazelle descends into these files is cryptic to them. They then ask a support question where it's not obvious that git clean -ffdx is the solution.

Gazelle should simply ignore things that are .gitignore'd (probably with a directive to opt-in/out)

alexeagle avatar Jan 28 '22 18:01 alexeagle

I think Gazelle has enough users that Hyrum's law would be applied here. I wonder how many users have git-ignored files that end up in the targets that depend on a flow like:

go generate -> some git-ignored files -> gazelle -> bazel build

I believe it would be wise to make it opt-in rather than opt-out.

f0rmiga avatar Jan 28 '22 20:01 f0rmiga

Facing a similar issue with git submodules. Would be happy to opt in.

garymm avatar Aug 30 '22 23:08 garymm