Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

Commit 21abe6a

Browse files
committed
fix(status): tableOutput show override constraints
Add `hasOverride` attribute to `BasicStatus` struct and use it to append "(override)" to projects with overridden constraints. Closes #892
1 parent eb5b757 commit 21abe6a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cmd/dep/status.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ func (out *tableOutput) BasicLine(bs *BasicStatus) {
9595
} else {
9696
constraint = bs.Constraint.String()
9797
}
98+
if bs.hasOverride {
99+
constraint += "(override)"
100+
}
98101
fmt.Fprintf(out.w,
99102
"%s\t%s\t%s\t%s\t%s\t%d\t\n",
100103
bs.ProjectRoot,
@@ -250,6 +253,7 @@ type BasicStatus struct {
250253
Revision gps.Revision
251254
Latest gps.Version
252255
PackageCount int
256+
hasOverride bool
253257
}
254258

255259
type MissingStatus struct {
@@ -338,7 +342,7 @@ func runStatusAll(ctx *dep.Ctx, out outputter, p *dep.Project, sm gps.SourceMana
338342
// Check if the manifest has an override for this project. If so,
339343
// set that as the constraint.
340344
if pp, has := p.Manifest.Ovr[proj.Ident().ProjectRoot]; has && pp.Constraint != nil {
341-
// TODO note somehow that it's overridden
345+
bs.hasOverride = true
342346
bs.Constraint = pp.Constraint
343347
} else {
344348
bs.Constraint = gps.Any()

0 commit comments

Comments
 (0)