Skip to content

Commit

Permalink
Remove support for godep and dep (#1541)
Browse files Browse the repository at this point in the history
These 2 package managers were archived a while ago
- godep: Feb 26, 2019 (more than 4 years ago)
- dep: Sep 09, 2020 (almost 3 years ago)

Since then, the community has largely adopted Go Module as the
canonicaly package manager.

Removing these old package managers to make it easier to maintain
Gazelle in the long run.
This also let use remove the dependency on pelletier/go-toml package.

(1): https://github.com/golang/dep
(2): https://github.com/tools/godep
  • Loading branch information
sluongng committed May 24, 2023
1 parent a1be474 commit 3106470
Show file tree
Hide file tree
Showing 55 changed files with 25 additions and 7,085 deletions.
2 changes: 0 additions & 2 deletions Design.rst
Original file line number Diff line number Diff line change
Expand Up @@ -515,8 +515,6 @@ github.com/bazelbuild/buildtools/build
github.com/bazelbuild/rules_go
Used to build and test Gazelle through Bazel. Gazelle can aslo be built on its
own with the Go SDK.
github.com/pelletier/go-toml
Used to import dependencies from dep Gopkg.lock files.
golang.org/x/tools/vcs
Used during dependency resolution to determine the repository prefix for a
given import path. This uses the network.
6 changes: 4 additions & 2 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ bazel_dep(name = "rules_proto", version = "4.0.0")
go_sdk = use_extension("@io_bazel_rules_go//go:extensions.bzl", "go_sdk")

# Known to exist since it is instantiated by rules_go itself.
use_repo(go_sdk, go_sdk = "go_default_sdk")
use_repo(
go_sdk,
go_sdk = "go_default_sdk",
)

non_module_deps = use_extension("//internal/bzlmod:non_module_deps.bzl", "non_module_deps")
use_repo(
Expand All @@ -35,7 +38,6 @@ use_repo(
"com_github_bmatcuk_doublestar_v4",
"com_github_fsnotify_fsnotify",
"com_github_google_go_cmp",
"com_github_pelletier_go_toml",
"com_github_pmezard_go_difflib",
"org_golang_x_mod",
"org_golang_x_sync",
Expand Down
8 changes: 4 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -564,8 +564,8 @@ The following flags are accepted:
The ``update-repos`` command updates repository rules. It can write the rules
to either the WORKSPACE (by default) or a .bzl file macro function. It can be
used to add new repository rules or update existing rules to the specified
version. It can also import repository rules from a ``go.mod``, ``go.work`` or a
``Gopkg.lock`` file.
version. It can also import repository rules from a ``go.mod`` or a ``go.work``
file.

.. code:: bash
Expand Down Expand Up @@ -596,7 +596,7 @@ The following flags are accepted:
+----------------------------------------------------------------------------------------------------------+----------------------------------------------+
| Import repositories from a file as `go_repository`_ rules. These rules will be added to the bottom of the WORKSPACE file or merged with existing rules. |
| |
| The lock file format is inferred from the file name. ``go.mod``, ``go.work` and, ``Gopkg.lock`` (the dep lock format) are all supported. |
| The lock file format is inferred from the file name. ``go.mod`` and ``go.work` are all supported. |
+----------------------------------------------------------------------------------------------------------+----------------------------------------------+
| :flag:`-repo_root dir` | |
+----------------------------------------------------------------------------------------------------------+----------------------------------------------+
Expand All @@ -612,7 +612,7 @@ The following flags are accepted:
+----------------------------------------------------------------------------------------------------------+----------------------------------------------+
| :flag:`-prune true|false` | :value:`false` |
+----------------------------------------------------------------------------------------------------------+----------------------------------------------+
| When true, Gazelle will remove `go_repository`_ rules that no longer have equivalent repos in the ``Gopkg.lock``/``go.mod`` file. |
| When true, Gazelle will remove `go_repository`_ rules that no longer have equivalent repos in the ``go.mod`` file. |
| |
| This flag can only be used with ``-from_file``. |
+----------------------------------------------------------------------------------------------------------+----------------------------------------------+
Expand Down
1 change: 0 additions & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ register_unittest_toolchains()
# gazelle:repository go_repository name=com_github_golang_mock importpath=github.com/golang/mock
# gazelle:repository go_repository name=com_github_golang_protobuf importpath=github.com/golang/protobuf
# gazelle:repository go_repository name=com_github_google_go_cmp importpath=github.com/google/go-cmp
# gazelle:repository go_repository name=com_github_pelletier_go_toml importpath=github.com/pelletier/go-toml
# gazelle:repository go_repository name=com_github_pmezard_go_difflib importpath=github.com/pmezard/go-difflib
# gazelle:repository go_repository name=com_github_prometheus_client_model importpath=github.com/prometheus/client_model
# gazelle:repository go_repository name=com_github_yuin_goldmark importpath=github.com/yuin/goldmark
Expand Down

0 comments on commit 3106470

Please sign in to comment.