-
Notifications
You must be signed in to change notification settings - Fork 595
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
Fix license headers #659
Fix license headers #659
Conversation
In theory we could use the latest (v0.18.0) version of the x/tools module but that would also bring upgrade of x/sys (transitive dependency of go-cty) from current v0.5.0 and full understanding of implications of that upgrade.
@@ -263,7 +262,7 @@ var _hcltok_trans_keys []byte = []byte{ | |||
233, 234, 237, 239, 240, 243, 48, 57, | |||
65, 90, 97, 122, 196, 218, 229, 236, | |||
10, 170, 181, 183, 186, 128, 150, 152, | |||
182, 184, 255, 192, 255, 128, 255, 173, | |||
182, 184, 255, 192, 255, 0, 127, 173, |
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.
I'm not entirely sure about the meaning of this byte slice but my understanding is that it will change even with a single character change in the corresponding Ragel file it is generated from.
Since two lines of license headers are being added there, that would explain this.
@@ -4,6 +4,24 @@ package json | |||
|
|||
import "strconv" | |||
|
|||
func _() { |
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.
This was added back in March 2019 to stringer in https://go-review.googlesource.com/c/tools/+/163637 which implies we have just not run stringer ever since it released the first stable version (v0.1.0
was released in January 2021).
I avoided pinning to some unstable old version just for that purpose and picked the latest compatible stable version.
This aims to fix a number of problems:
copywrite
tool without reflecting the fact they are generated (and that they should get generated with the headers already)go generate ./...
implies a dependency on stringer, which is a Go library that can be tracked as such to provide reproducible results.Closes #637
Next step, which I'm expecting to be a separate PR, would be to add some ways of checking for license headers both in the CI and locally, perhaps similar to what we do in
hashicorp/terraform
.