Skip to content

Commit adf09bc

Browse files
committed
Cleanup name references
1 parent 72bfeb5 commit adf09bc

File tree

2 files changed

+19
-16
lines changed

2 files changed

+19
-16
lines changed

language/scala/cleanup.go

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,31 +15,33 @@ import (
1515

1616
const (
1717
// SCALA_GAZELLE_UNMANAGED_DEPS_FILE is an environment variable that, if
18-
// defined, activates the saving of uncorrelated deps for a given set of
18+
// defined, activates the saving of unmanaged deps for a given set of
1919
// rules that have recorded it.
2020
SCALA_GAZELLE_UNMANAGED_DEPS_FILE = procutil.EnvVar("SCALA_GAZELLE_UNMANAGED_DEPS_FILE")
2121
)
2222

2323
// cleanup is the top-level function for various cleanup related features.
2424
func (sl *scalaLang) cleanup() {
2525
if err := sl.cleanupUnmanagedDeps(); err != nil {
26-
log.Println("warning: cleanup uncorrelated deps failed: %v", err)
26+
log.Println("warning: cleanup unmanaged deps failed: %v", err)
2727
}
2828
}
2929

3030
func (sl *scalaLang) cleanupUnmanagedDeps() error {
3131
if filename, ok := procutil.LookupEnv(SCALA_GAZELLE_UNMANAGED_DEPS_FILE); ok {
32-
return sl.saveUncorrelatedDepsFile(filename)
32+
return sl.saveUnmanagedDepsFile(filename)
3333
} else {
34+
log.Println("SCALA_GAZELLE_UNMANAGED_DEPS_FILE not set")
3435
sl.logger.Debug().Msg("SCALA_GAZELLE_UNMANAGED_DEPS_FILE not set")
3536
}
3637
return nil
3738
}
3839

39-
func (sl *scalaLang) saveUncorrelatedDepsFile(filename string) error {
40-
deps := sl.makeUncorrelatedDeps()
40+
func (sl *scalaLang) saveUnmanagedDepsFile(filename string) error {
41+
deps := sl.makeUnmanagedDeps()
4142
if len(deps) == 0 {
42-
sl.logger.Debug().Msg("SCALA_GAZELLE_UNMANAGED_DEPS_FILE not written (no uncorrelated deps to write)")
43+
log.Println("SCALA_GAZELLE_UNMANAGED_DEPS_FILE not written (no unmanaged deps to write)")
44+
sl.logger.Debug().Msg("SCALA_GAZELLE_UNMANAGED_DEPS_FILE not written (no unmanaged deps to write)")
4345
return nil
4446
}
4547

@@ -53,22 +55,23 @@ func (sl *scalaLang) saveUncorrelatedDepsFile(filename string) error {
5355
return err
5456
}
5557

56-
sl.logger.Debug().Msg("Wrote uncorrelated deps to " + filename)
58+
log.Println("Wrote unmanaged deps to " + filename)
59+
sl.logger.Debug().Msgf("Wrote unmanaged deps to %s", filename)
5760

5861
return nil
5962
}
6063

61-
func (sl *scalaLang) makeUncorrelatedDeps() []UncorrelatedDeps {
62-
nonDirect := make(map[label.Label]UncorrelatedDeps)
64+
func (sl *scalaLang) makeUnmanagedDeps() []UnmanagedDeps {
65+
nonDirect := make(map[label.Label]UnmanagedDeps)
6366

6467
for from, rule := range sl.knownRules {
6568
if deps, ok := rule.PrivateAttr(scalaconfig.UnmanagedDepsPrivateAttrName).([]string); ok {
66-
nonDirect[from] = UncorrelatedDeps{from: from, deps: deps}
67-
sl.logger.Debug().Str("from", from.String()).Msgf("uncorrelated deps: %v", deps)
69+
nonDirect[from] = UnmanagedDeps{from: from, deps: deps}
70+
sl.logger.Debug().Str("from", from.String()).Msgf("unmanaged deps: %v", deps)
6871
}
6972
}
7073

71-
deps := make([]UncorrelatedDeps, 0, len(nonDirect))
74+
deps := make([]UnmanagedDeps, 0, len(nonDirect))
7275
for _, d := range nonDirect {
7376
deps = append(deps, d)
7477
}
@@ -82,11 +85,11 @@ func (sl *scalaLang) makeUncorrelatedDeps() []UncorrelatedDeps {
8285
return deps
8386
}
8487

85-
type UncorrelatedDeps struct {
88+
type UnmanagedDeps struct {
8689
from label.Label
8790
deps []string
8891
}
8992

90-
func (td *UncorrelatedDeps) String() string {
93+
func (td *UnmanagedDeps) String() string {
9194
return fmt.Sprintf("%v %v", td.from.String(), strings.Join(td.deps, " "))
9295
}

pkg/scalaconfig/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ const (
141141
// target, has the same effect as the directive 'scala_keep_unmanaged_deps
142142
// false'
143143
NoUnknownDepsTagName = "no-unknown-deps"
144-
// UnmanagedDepsPrivateAttrName is a private attr key where uncorrelated
145-
// deps are stored.
144+
// UnmanagedDepsPrivateAttrName is a private attr key where unmanaged deps
145+
// are stored.
146146
UnmanagedDepsPrivateAttrName = "_unmanaged_deps"
147147
)
148148

0 commit comments

Comments
 (0)