Skip to content

Add check to see if testdata is empty when determining when to add data#2262

Merged
jayconrod merged 6 commits intobazel-contrib:masterfrom
sohumk-stripe:empty-testdata-patch
Jan 7, 2026
Merged

Add check to see if testdata is empty when determining when to add data#2262
jayconrod merged 6 commits intobazel-contrib:masterfrom
sohumk-stripe:empty-testdata-patch

Conversation

@sohumk-stripe
Copy link
Copy Markdown
Contributor

What type of PR is this?

Bug fix

What package or component does this PR mostly affect?

language/go

What does this PR do? Why is it needed?

Adds logic to check that a testdata subdirectory is not empty before adding it as a data source.

Which issues(s) does this PR fix?

Fixes #2233

@fmeum fmeum requested a review from jayconrod January 2, 2026 19:55
Copy link
Copy Markdown
Contributor

@jayconrod jayconrod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix seems reasonable. Please add a test in //tests.

Comment thread language/go/generate.go Outdated
Comment thread language/go/generate.go Outdated
Copy link
Copy Markdown
Contributor

@jayconrod jayconrod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks good.

I appreciate your patience with Walk and with the tests. Reducing I/O should speed things up. I'm working on Gazelle v2, and fixing walk.GetDirInfo will be part of that (among many other things).

@jayconrod jayconrod merged commit ff2b7cf into bazel-contrib:master Jan 7, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gazelle adds data source even for empty testdata directory

3 participants