Skip to content
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
4 changes: 1 addition & 3 deletions gazelle/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
# gazelle:prefix github.com/bazel-contrib/rules_python/gazelle
# gazelle:exclude bazel-out
# gazelle:exclude deps.bzl
# gazelle:exclude internal
# gazelle:exclude internal_dev_deps.bzl
# gazelle:resolve go github.com/tree-sitter/tree-sitter-python/bindings/go @com_github_tree_sitter_tree_sitter_python//:go_default_library
gazelle(
name = "gazelle",
)
Expand Down Expand Up @@ -38,7 +36,7 @@ filegroup(
"//modules_mapping:distribution",
"//python:distribution",
"//pythonconfig:distribution",
] + glob(["internal/**"]),
],
visibility = ["@rules_python//:__pkg__"],
)

Expand Down
20 changes: 1 addition & 19 deletions gazelle/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ bazel_dep(name = "bazel_skylib", version = "1.8.2")
bazel_dep(name = "rules_python", version = "1.5.0")
bazel_dep(name = "rules_go", version = "0.59.0", repo_name = "io_bazel_rules_go")
bazel_dep(name = "gazelle", version = "0.47.0", repo_name = "bazel_gazelle")
bazel_dep(name = "rules_cc", version = "0.0.16")

local_path_override(
module_name = "rules_python",
Expand All @@ -23,29 +22,12 @@ use_repo(
"com_github_bmatcuk_doublestar_v4",
"com_github_emirpasic_gods",
"com_github_ghodss_yaml",
"com_github_mattn_go_pointer",
"com_github_odvcencio_gotreesitter",
"com_github_stretchr_testify",
"in_gopkg_yaml_v2",
"org_golang_x_sync",
)

http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "com_github_tree_sitter_go_tree_sitter",
build_file = "//:internal/go_tree_sitter_BUILD.bazel",
integrity = "sha256-rAsyh/Kydqt24TBaA6H14obQlkaQWwj1QNec3xza6NM=",
strip_prefix = "go-tree-sitter-c9492002f76ed75037e3fe6d3bbabb54ed3e1ff5",
url = "https://github.com/tree-sitter/go-tree-sitter/archive/c9492002f76ed75037e3fe6d3bbabb54ed3e1ff5.zip",
)

http_archive(
name = "com_github_tree_sitter_tree_sitter_python",
build_file = "//:internal/tree_sitter_python_BUILD.bazel",
integrity = "sha256-e86IfrLzPpS/dKaWRc9RONQJZyDlT9MmmmEkwGuTxYQ=",
url = "https://github.com/tree-sitter/tree-sitter-python/releases/download/v0.25.0/tree-sitter-python.tar.gz",
)

python_stdlib_list = use_extension("//python:extensions.bzl", "python_stdlib_list")
use_repo(
python_stdlib_list,
Expand Down
46 changes: 4 additions & 42 deletions gazelle/deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -31,49 +31,11 @@ def python_stdlib_list_deps():
url = "https://files.pythonhosted.org/packages/8c/25/f1540879c8815387980e56f973e54605bd924612399ace31487f7444171c/stdlib_list-0.12.0.tar.gz",
)

def tree_sitter_deps():
"Fetch tree-sitter dependencies with custom BUILD files"
if "com_github_tree_sitter_go_tree_sitter" not in native.existing_rules():
http_archive(
name = "com_github_tree_sitter_go_tree_sitter",
build_file = Label("//:internal/go_tree_sitter_BUILD.bazel"),
integrity = "sha256-rAsyh/Kydqt24TBaA6H14obQlkaQWwj1QNec3xza6NM=",
strip_prefix = "go-tree-sitter-c9492002f76ed75037e3fe6d3bbabb54ed3e1ff5",
url = "https://github.com/tree-sitter/go-tree-sitter/archive/c9492002f76ed75037e3fe6d3bbabb54ed3e1ff5.zip",
)
if "com_github_tree_sitter_tree_sitter_python" not in native.existing_rules():
http_archive(
name = "com_github_tree_sitter_tree_sitter_python",
build_file = Label("//:internal/tree_sitter_python_BUILD.bazel"),
integrity = "sha256-e86IfrLzPpS/dKaWRc9RONQJZyDlT9MmmmEkwGuTxYQ=",
url = "https://github.com/tree-sitter/tree-sitter-python/releases/download/v0.25.0/tree-sitter-python.tar.gz",
)

def gazelle_deps():
tree_sitter_deps()
go_deps()
python_stdlib_list_deps()

def go_deps():
# Prevent `bazel run //:gazelle_update_repos` from generating `go_repository`
# entries for the repos managed by `tree_sitter_deps()` or for the 11 other
# language grammars required by upstream `go-tree-sitter/go.mod` for its own
# internal unit tests. Without these directives, `gazelle update-repos` sees
# those modules in `go list -m all` and re-adds them here; declaring
# `# gazelle:repository` directives tells `update-repos` to skip them.
# gazelle:repository http_archive name=com_github_tree_sitter_go_tree_sitter
# gazelle:repository http_archive name=com_github_tree_sitter_tree_sitter_c
# gazelle:repository http_archive name=com_github_tree_sitter_tree_sitter_cpp
# gazelle:repository http_archive name=com_github_tree_sitter_tree_sitter_embedded_template
# gazelle:repository http_archive name=com_github_tree_sitter_tree_sitter_go
# gazelle:repository http_archive name=com_github_tree_sitter_tree_sitter_html
# gazelle:repository http_archive name=com_github_tree_sitter_tree_sitter_java
# gazelle:repository http_archive name=com_github_tree_sitter_tree_sitter_javascript
# gazelle:repository http_archive name=com_github_tree_sitter_tree_sitter_json
# gazelle:repository http_archive name=com_github_tree_sitter_tree_sitter_php
# gazelle:repository http_archive name=com_github_tree_sitter_tree_sitter_python
# gazelle:repository http_archive name=com_github_tree_sitter_tree_sitter_ruby
# gazelle:repository http_archive name=com_github_tree_sitter_tree_sitter_rust
"Fetch go dependencies"
go_repository(
name = "com_github_bazelbuild_bazel_gazelle",
Expand Down Expand Up @@ -149,10 +111,10 @@ def go_deps():
version = "v0.6.0",
)
go_repository(
name = "com_github_mattn_go_pointer",
importpath = "github.com/mattn/go-pointer",
sum = "h1:n+XhsuGeVO6MEAp7xyEukFINEa+Quek5psIR/ylA6o0=",
version = "v0.0.1",
name = "com_github_odvcencio_gotreesitter",
importpath = "github.com/odvcencio/gotreesitter",
sum = "h1:FjtamNv5ke7SJlQxJnL75FEp3hZWVHDKBY3jXEcQw8Q=",
version = "v1.0.0-rc.1",
)
go_repository(
name = "com_github_pmezard_go_difflib",
Expand Down
5 changes: 2 additions & 3 deletions gazelle/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,16 @@ require (
github.com/bmatcuk/doublestar/v4 v4.9.1
github.com/emirpasic/gods v1.18.1
github.com/ghodss/yaml v1.0.0
github.com/odvcencio/gotreesitter v1.0.0-rc.1
github.com/stretchr/testify v1.9.0
github.com/tree-sitter/go-tree-sitter v0.24.1-0.20251112183152-c9492002f76e
github.com/tree-sitter/tree-sitter-python v0.25.0
golang.org/x/sync v0.11.0
gopkg.in/yaml.v2 v2.4.0
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/mattn/go-pointer v0.0.1 // indirect
github.com/kr/text v0.1.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
golang.org/x/mod v0.23.0 // indirect
golang.org/x/sys v0.30.0 // indirect
Expand Down
16 changes: 9 additions & 7 deletions gazelle/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,17 @@ github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/mattn/go-pointer v0.0.1 h1:n+XhsuGeVO6MEAp7xyEukFINEa+Quek5psIR/ylA6o0=
github.com/mattn/go-pointer v0.0.1/go.mod h1:2zXcozF6qYGgmsG+SeTZz3oAbFLdD3OWqnUbNvJZAlc=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/odvcencio/gotreesitter v1.0.0-rc.1 h1:FjtamNv5ke7SJlQxJnL75FEp3hZWVHDKBY3jXEcQw8Q=
github.com/odvcencio/gotreesitter v1.0.0-rc.1/go.mod h1:hBVkghd0paaYAVwd2087vfwdeU984bQbMo9LvpE0moo=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/tree-sitter/go-tree-sitter v0.24.1-0.20251112183152-c9492002f76e h1:B9WMBx89/TkqtmwfP+7OhREoGB6RdgmGk9ErlbiTOFI=
github.com/tree-sitter/go-tree-sitter v0.24.1-0.20251112183152-c9492002f76e/go.mod h1:r77ig7BikoZhHrrsjAnv8RqGti5rtSyvDHPzgTPsUuU=
github.com/tree-sitter/tree-sitter-python v0.25.0 h1:O6XD9v8U1LOcRc3cNj9nM7XufrtEBezE6VrpRrHZDf0=
github.com/tree-sitter/tree-sitter-python v0.25.0/go.mod h1:cpdthSy/Yoa28aJFBscFHlGiU+cnSiSh1kuDVtI8YeM=
golang.org/x/mod v0.23.0 h1:Zb7khfcRGKk+kqfxFaP5tZqCnDZMjC5VtUBs87Hr6QM=
golang.org/x/mod v0.23.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w=
Expand All @@ -32,8 +33,9 @@ golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/tools/go/vcs v0.1.0-deprecated h1:cOIJqWBl99H1dH5LWizPa+0ImeeJq3t3cJjaeOWUAL4=
golang.org/x/tools/go/vcs v0.1.0-deprecated/go.mod h1:zUrvATBAvEI9535oC0yWYsLsHIV4Z7g63sNPVMtuBy8=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
Expand Down
47 changes: 0 additions & 47 deletions gazelle/internal/go_tree_sitter_BUILD.bazel

This file was deleted.

36 changes: 0 additions & 36 deletions gazelle/internal/tree_sitter_python_BUILD.bazel

This file was deleted.

4 changes: 2 additions & 2 deletions gazelle/python/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ go_library(
"@com_github_emirpasic_gods//lists/singlylinkedlist",
"@com_github_emirpasic_gods//sets/treeset",
"@com_github_emirpasic_gods//utils",
"@com_github_tree_sitter_go_tree_sitter//:go-tree-sitter",
"@com_github_tree_sitter_tree_sitter_python//:go_default_library",
"@com_github_odvcencio_gotreesitter//:gotreesitter",
"@com_github_odvcencio_gotreesitter//grammars/python",
"@org_golang_x_sync//errgroup",
],
)
Expand Down
Loading
Loading