Skip to content
This repository has been archived by the owner on Nov 25, 2019. It is now read-only.

novendor: option to consider all vendored projects source packages for the purpose of determining packages that are used #16

Open
nmiyake opened this issue Feb 8, 2017 · 1 comment

Comments

@nmiyake
Copy link
Collaborator

nmiyake commented Feb 8, 2017

Consider the following example:

vendor/github.com/org/project
  |--> foo
  |--> bar
vendor/github.com/org-2/project-2
  |--> baz

The main project code imports org/project/foo.
org/project/bar imports org-2/project-2/baz.

Currently, if novendor is run in this scenario, org-2/project-2/baz will be reported as unused. Internally, org/project/bar is also considered unused, but because the heuristic indicates that it is part of a "project" (org/project) that is used, it is not reported.

Based on this report, the logical course of action is to remove org-2/project-2. Although this will work, if a command like go build ./... or go install ./... is run, org/project/bar will complain because its dependency (org-2/project-2/baz) is missing.

novendor should provide an option that offers a way out of this scenario without explicit whitelisting. The idea would be that all "projects" that are considered by novendor should also be treated as source roots, and the dependency graphs for those packages should be included in the check.

In the scenario outlined above, running the check in this mode would not report any unused packages.

@nmiyake nmiyake changed the title novendor: option to include all code in vendored libraries as part of a check novendor: option to consider all vendored projects source packages for the purpose of determining packages that are used Feb 8, 2017
nmiyake added a commit that referenced this issue May 3, 2017
Fixes issue where novendor would report some vendored packages as
unused, even though they should not be considered as such when
using the project-level grouping paradigm.

Fixes #16
nmiyake added a commit that referenced this issue May 3, 2017
Fixes issue where novendor would report some vendored packages as
unused, even though they should not be considered as such when
using the project-level grouping paradigm.

Fixes #16
nmiyake added a commit that referenced this issue May 3, 2017
Fixes issue where novendor would report some vendored packages as
unused, even though they should not be considered as such when
using the project-level grouping paradigm.

Fixes #16
nmiyake added a commit that referenced this issue May 3, 2017
Fixes issue where novendor would report some vendored packages as
unused, even though they should not be considered as such when
using the project-level grouping paradigm.

Fixes #16
@nmiyake
Copy link
Collaborator Author

nmiyake commented Jul 17, 2017

Reverted feature because it was causing performance issues. Should be possible to do in a better manner, but re-opening until that can be done.

@nmiyake nmiyake reopened this Jul 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant