Conversation
cbce8ad to
6b3df82
Compare
6b3df82 to
2bc243c
Compare
flwyd
left a comment
There was a problem hiding this comment.
I'm not sure it's a good idea to encourage use of (c) instead of the full word "Copyright". While Wikipedia says the U.S. Copyright Office accepts it as a copyright mark, I'm unaware of a reason that it would be preferred over the word "Copyright" at the top of a source code file.
Could you share some example projects that use this convention?
| license = flag.String("l", "apache", "license type: apache, bsd, mit, mpl") | ||
| licensef = flag.String("f", "", "license file") | ||
| year = flag.String("y", fmt.Sprint(time.Now().Year()), "copyright year(s)") | ||
| copyright = flag.String("x", "(c)", "custom copyright string used to determine license header presence") |
There was a problem hiding this comment.
By defining (c) as the default value of the flag, it gets added as a copyright header for anyone who doesn't specify the flag. Empty string is probably a better default, but don't do a Contains check on empty string, because all arrays contain a zero-byte subarray.
Is there a reason you chose x as the flag name? I can't think of a mnemonic. A full-word flag name is probably clearer.
| -f custom license file (no default) | ||
| -l license type: apache, bsd, mit, mpl (defaults to "apache") | ||
| -y year (defaults to current year) | ||
| -x custom license check, can be used with custom license to properly check presence of header (defaults to "(c)") |
There was a problem hiding this comment.
The string "(c)" may result in some false positives, e.g. an (a) (b) (c) list or a reference to a 501(c)3 organization.
The goal of this PR is to allow users to provide a custom copyright string. The copyright string can be used in conjunction with a custom template to ensure duplicate copyright headers are not created when the copyright string doesn't match the pre-defined collection:
copyright,mozilla public, orspdx-license-identifier.EDIT: Any guidance here is appreciated, if someone can spare it. Is there anything else I should plan to do for this PR? @willnorris
Fixes #56