Skip to content

Commit cff969d

Browse files
f0rmigarenovate[bot]
authored andcommitted
chore(deps): bump gazelle and sync versions (#1211)
Renovate tried to bump gazelle, but it couldn't because of the patches we had, so I removed them and fixed the code. Signed-off-by: Thulio Ferraz Assis <3149049+f0rmiga@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> GitOrigin-RevId: a4ab91c347eb923a78ebaf356cb4e067a165f6ba
1 parent c25f7c1 commit cff969d

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

pkg/aspect/configure/BUILD.bazel

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
load("@io_bazel_rules_go//go:def.bzl", "go_library")
22

3-
# gazelle:resolve go github.com/bazelbuild/bazel-gazelle/internal/wspace @bazel_gazelle//internal/wspace
4-
53
go_library(
64
name = "configure",
75
srcs = [
@@ -20,7 +18,6 @@ go_library(
2018
"//pkg/ioutils",
2119
"@bazel_gazelle//config:go_default_library",
2220
"@bazel_gazelle//flag:go_default_library",
23-
"@bazel_gazelle//internal/wspace",
2421
"@bazel_gazelle//label:go_default_library",
2522
"@bazel_gazelle//language:go_default_library",
2623
"@bazel_gazelle//language/go:go_default_library",

pkg/aspect/configure/fix-update.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import (
2828

2929
"github.com/bazelbuild/bazel-gazelle/config"
3030
gzflag "github.com/bazelbuild/bazel-gazelle/flag"
31-
"github.com/bazelbuild/bazel-gazelle/internal/wspace"
3231
"github.com/bazelbuild/bazel-gazelle/label"
3332
"github.com/bazelbuild/bazel-gazelle/language"
3433
"github.com/bazelbuild/bazel-gazelle/merger"
@@ -137,7 +136,7 @@ func (ucr *updateConfigurer) CheckFlags(fs *flag.FlagSet, c *config.Config) erro
137136
// dependency resolution for Go.
138137
// TODO(jayconrod): Go-specific code should be moved to language/go.
139138
if ucr.repoConfigPath == "" {
140-
ucr.repoConfigPath = wspace.FindWORKSPACEFile(c.RepoRoot)
139+
ucr.repoConfigPath = findWORKSPACEFile(c.RepoRoot)
141140
}
142141
repoConfigFile, err := rule.LoadWorkspaceFile(ucr.repoConfigPath, "")
143142
if err != nil && !os.IsNotExist(err) {
@@ -165,7 +164,7 @@ func (ucr *updateConfigurer) CheckFlags(fs *flag.FlagSet, c *config.Config) erro
165164

166165
// If the repo configuration file is not WORKSPACE, also load WORKSPACE
167166
// and any declared macro files so we can apply fixes.
168-
workspacePath := wspace.FindWORKSPACEFile(c.RepoRoot)
167+
workspacePath := findWORKSPACEFile(c.RepoRoot)
169168
var workspace *rule.File
170169
if ucr.repoConfigPath == workspacePath {
171170
workspace = repoConfigFile
@@ -455,7 +454,7 @@ func fixRepoFiles(c *config.Config, loads []rule.LoadInfo) error {
455454

456455
for _, f := range uc.workspaceFiles {
457456
merger.FixLoads(f, loads)
458-
workspaceFile := wspace.FindWORKSPACEFile(c.RepoRoot)
457+
workspaceFile := findWORKSPACEFile(c.RepoRoot)
459458

460459
if f.Path == workspaceFile {
461460
removeLegacyGoRepository(f)
@@ -581,3 +580,11 @@ func appendOrMergeKindMapping(mappedLoads []rule.LoadInfo, mappedKind config.Map
581580
Symbols: []string{mappedKind.KindName},
582581
})
583582
}
583+
584+
func findWORKSPACEFile(root string) string {
585+
pathWithExt := filepath.Join(root, "WORKSPACE.bazel")
586+
if _, err := os.Stat(pathWithExt); err == nil {
587+
return pathWithExt
588+
}
589+
return filepath.Join(root, "WORKSPACE")
590+
}

pkg/aspect/init/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ go_library(
1414
"//pkg/ioutils",
1515
"@com_github_fatih_color//:color",
1616
"@com_github_manifoldco_promptui//:promptui",
17-
"@com_github_masterminds_semver//:semver",
17+
"@com_github_masterminds_semver_v3//:semver",
1818
"@com_github_spf13_cobra//:cobra",
1919
],
2020
)

pkg/aspect/init/init.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ import (
2323
"path"
2424
"strings"
2525

26+
"github.com/Masterminds/semver"
2627
"aspect.build/cli/buildinfo"
2728
"aspect.build/cli/docs/bazelrc"
2829
"aspect.build/cli/pkg/aspect/init/template"
2930
"aspect.build/cli/pkg/bazel"
3031
"aspect.build/cli/pkg/bazel/workspace"
3132
"aspect.build/cli/pkg/ioutils"
32-
"github.com/Masterminds/semver"
3333
"github.com/fatih/color"
3434
"github.com/manifoldco/promptui"
3535
"github.com/spf13/cobra"

0 commit comments

Comments
 (0)