-
Notifications
You must be signed in to change notification settings - Fork 1k
ensure: add tests and behavior for when a dep is unused #108
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so a -require
flag is gonna be a bit different because gps treats requires (and ignores) at the package-level, not the project level.
|
||
if !found { | ||
fmt.Fprintf(os.Stdout, `WARNING: %s was requested but is not imported in your code. | ||
Run again with --require to ensure it is vendored and added to the lock. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: one dash
@@ -153,6 +157,44 @@ func (cmd *ensureCommand) Run(args []string) error { | |||
} | |||
} | |||
|
|||
// add all the required packages to required in the manifest | |||
for _, arg := range cmd.requires { | |||
pc, err := getProjectConstraint(arg, sm) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because requires are pkg-level rather than project-level, i wonder if it might be better to not allow the user to specify a constraint at the same time as they specify a require (or an ignore)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm idk because then they would have to put it twice to ensure we could just say you get the project at the constraint but you are requiring that it doesn't disappear since you aren't using it
Signed-off-by: Jess Frazelle <[email protected]>
Signed-off-by: Jess Frazelle <[email protected]>
I'm gonna close this out, since we're moving towards a different vision of |
behaves in the following way:
part of #36