-
Notifications
You must be signed in to change notification settings - Fork 84
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
verify_boilerplate.py: auto skip YEAR
in generated files
#233
verify_boilerplate.py: auto skip YEAR
in generated files
#233
Conversation
6f26b2f
to
055b24c
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.
/lgtm
/assign @mikedanese |
/assign |
@cpanato will take a look at this in a bit. i have opinions :) |
@@ -135,6 +133,13 @@ def file_passes(filename, refs, regexs): # pylint: disable=too-many-locals | |||
# trim our file to the same number of lines as the reference file | |||
data = data[:len(ref)] | |||
|
|||
# remove the 'YEAR' placeholder from the ref if the file is generated | |||
if is_generated(file_data): |
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.
looks like we are updating very specific files ... from this list:
https://github.com/kubernetes/repo-infra/blob/master/hack/verify_boilerplate.py#L76-L93
Also looks like the year is not needed in CNCF guidance:
https://github.com/cncf/foundation/blob/master/copyright-notices.md
So for this specific set of generated files, +1 to drop the year. Let's just not do this for any other files.
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.
Should we instead display an error if YEAR is used in the copyright header for generated files (similar to k/k)? This would help ensure consistency across generated files.
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.
@nikhita yes
I fear that we will break existing licence files if we merge a change like this.
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.
though repo-infra is not immediately upgraded anywhere and it shouldn't block go upgrades anymore ™️ now that k/k doesn't use bazel
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.
Changed it to return an error if it contains the YEAR
placeholder and is generated.
055b24c
to
0da6e3a
Compare
4fe875a
to
a339547
Compare
We should not skip generated files entirely, but only skip checking for the `YEAR`. This patch changes the current behavior to only strip the year from the ref. Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
a339547
to
80d4b7e
Compare
@dims @nikhita @BenTheElder @saschagrunert -- Have all of the reviews been addressed here? |
Yes, from my point of view. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cpanato, justaugustus, saschagrunert The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
We should not skip generated files entirely, but only skip checking for
the
YEAR
. This patch changes the current behavior to only strip theyear from the ref.