fix: enforce current year in copyright header of new files#36
Closed
alexmohr wants to merge 2 commits into
Closed
Conversation
5c1a92b to
0544fba
Compare
When a new file (not yet present in HEAD) already carries an SPDX-FileCopyrightText header, validate that the year matches the current year. Existing files are unchanged - only the annotation path (no prior header) is affected, which already stamps the current year via reuse annotate. The new check covers the gap where a developer manually writes a stale year in a brand-new file. Signed-off-by: Alexander Mohr <alexander.m.mohr@mercedes-benz.com>
0544fba to
9d12c1e
Compare
Contributor
Author
|
Work integrated into PR #39 (feat/pre-commit-hook-args-config). The enforce-current-year logic was rebased onto the args-config branch and the os.environ fallbacks replaced with clean argparse defaults. |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
reuse-annotate-hook.pywhere a newly added file that already carries anSPDX-FileCopyrightTextheader with a stale year was silently acceptedis_git_new_file()to detect files not yet present in HEAD (viagit ls-files+git show HEAD:<path>)check_copyright_year_for_new_file()to validate the year in the header matches the current year, failing with a clear error if notChecklist
Related
Notes for Reviewers
Alexander Mohr alexander.m.mohr@mercedes-benz.com, Mercedes-Benz Tech Innovation GmbH
Provider Information