Skip to content

feat(gazelle) Remove entry point file requirements when generating rules #2998

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions gazelle/python/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ func (py *Python) GenerateRules(args language.GenerateArgs) language.GenerateRes
if parent != nil && parent.CoarseGrainedGeneration() {
return language.GenerateResult{}
}
} else if !hasEntrypointFile(args.Dir) {
return language.GenerateResult{}
}
}

Expand Down
1 change: 1 addition & 0 deletions gazelle/python/testdata/relative_imports/BUILD.in
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# gazelle:resolve py resolved_package //package2:resolved_package
# gazelle:python_generation_mode project
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why were these directives needed to be added?

1 change: 1 addition & 0 deletions gazelle/python/testdata/relative_imports/BUILD.out
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
load("@rules_python//python:defs.bzl", "py_binary", "py_library")

# gazelle:resolve py resolved_package //package2:resolved_package
# gazelle:python_generation_mode project

py_library(
name = "relative_imports",
Expand Down
1 change: 1 addition & 0 deletions gazelle/python/testdata/subdir_sources/BUILD.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# gazelle:python_generation_mode project
3 changes: 3 additions & 0 deletions gazelle/python/testdata/subdir_sources/BUILD.out
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@

load("@rules_python//python:defs.bzl", "py_binary")

# gazelle:python_generation_mode project

py_binary(
name = "subdir_sources_bin",
srcs = ["__main__.py"],
Expand Down