-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat!(v2): use go modules info #94
Conversation
e3fc617
to
30635f9
Compare
e06b387
to
6598151
Compare
5cc6d1d
to
09e68a1
Compare
Updated to point to master branch |
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.
More comments may come once this is rebased 🙏
return "", wrap(err) | ||
} | ||
// TODO: there are still rare cases this may result in an incorrect URL. | ||
// https://github.com/google/go-licenses/issues/73#issuecomment-1005587408 |
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.
Might be worthwhile to document examples of the types of URLs that are problematic (I didn't get a clear sense what "major branch conventions" meant from the comment)
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.
Sure, let me expand on the comment and leave a TODO in v2 roadmap to document known caveats.
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.
Updated in #73 (comment), note I have already built workarounds for these special cases in follow up PRs.
b265450
to
c4d4297
Compare
csv.go
Outdated
// Using ", " to join words makes vscode/terminal recognize the | ||
// correct license URL. Otherwise, if there's no space after | ||
// comma, vscode interprets the URL as concatenated with the | ||
// license name after it. | ||
// Also, the extra spaces does not affect csv syntax much, we | ||
// can still copy the csv text and paste into Excel / Google | ||
// Sheets. | ||
if _, err := fmt.Fprintln(os.Stdout, strings.Join([]string{lib.Name(), licenseURL, licenseName}, ", ")); err != nil { |
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.
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.
Agree, I'll discuss it separately
TODO: revert git.go, because we will still use it in the future. |
b79dc6f
to
7a12b72
Compare
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.
one last comment, otherwise lgtm!
csv.go
Outdated
} | ||
} | ||
// Remove the "*/vendor/" prefix from the library name for conciseness. | ||
if err := writer.Write([]string{unvendor(lib.Name()), licenseURL, licenseName}); err != nil { | ||
if _, err := fmt.Fprintln(os.Stdout, strings.Join([]string{lib.Name(), licenseURL, licenseName}, ",")); err != nil { |
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: i'd just revert to the previous csv.Writer
behavior.
There's a few other quirks in CSV behavior that while I'm not 100% sure we need to worry about, it's easier to just trust the csv library to handle it properly instead of rolling our own.
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.
No problem, just reverted this.
UPDATE: although this is a breaking change, we decided to release it in v1.1, because we don't believe there are still people not using go modules... That's our assumption, let us know if the new release breaks you!
BREAKING CHANGE: this tool no longer natively supports go projects managed by GOPATH. It only works with go modules projects now.
Changes: