-
Notifications
You must be signed in to change notification settings - Fork 1k
dep: Permit no Go source for ensure -add #1325
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
I signed it! |
CLAs look good, thanks! |
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.
ah, thanks for taking this on!
adding a new param is a bit of a hack, but it's not the end of the world. we definitely need a test for this, though! something under cmd/dep/testdata/harness_tests
.
cmd/dep/ensure.go
Outdated
if allowNoGo { | ||
noGoErrors = 0 | ||
} | ||
|
||
// If pkgtree was empty or all dirs lacked any Go code, return an error. | ||
if len(m) == 0 || len(m) == noGoErrors { |
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.
the only problem is the len(m) == 0
case. it's not likely to be reachable under normal circumstances - the directory Gopkg.toml
is in will always be scanned, so there's always going to be at least one - but it's probably possible to hit it with ignores. so, both checks will need modification.
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.
Fixed in 40f0f41.
bump - anything i can do to help this along? |
Sorry for the delayed reply! Just came back from holiday 😎. Just had a thought - instead of completely forgetting about the "no dirs contained any Go code" error, is it worth instead returning that as a non-fatal error? Regarding the test case - am I best putting this in |
Just noticed that @arbourd commented on build errors also causing
|
Dep was officially deprecated earlier this year, and the proposal to archive this repository was accepted. As such, I'm closing outstanding issues before archiving the repository. For any further comments, please use the proposal thread on the Go issue tracker. Thanks! |
What does this do / why do we need it?
Allows a directory to contain no Go code when running
dep ensure -add
Do you need help or clarification on anything?
Is this the best way to do it? I feel like there may be a better way than setting
noGoErrors
to 0 - should I not incrementnoGoErrors
ifallowNoGoErrors
istrue
? Or maybe change both of theif
statements which depend onnoGoErrors
to checkallowNoGoErrors
too?Does a new test need creating to cover this?
Which issue(s) does this PR fix?
#1312: dep ensure -add should not depend on Go code