/ curl Public
checksrc: add COPYRIGHT year check #3303
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.
This is a patch which I had shelved deeming it too uninteresting/complicated to be useful, but when discussing the recent
snprintf()switcheroo in #3297 the topic was brought up again. This is more of a discussion piece/show-and-tell PR than something I really think we should do, but working code is generally nicer to discuss around than handwaving so here goes.
The check for updated copyright year is currently not enforced on any file but only on files edited and/or committed locally. This is due to the amount of files which aren't updated with their correct copyright year at the time of their respective commit. If enforced for the correct year, there are hundreds of errors which is painful. We could of course just sed the list of files to the current year and be done with it, but then we could just as well bump every file in the tree and there are reasons why we don't do that.
Invoking the checking like in this patch is rather expensive, and obviously only works on cloned repos and not source tarballs (which in this day and age really isn't used for active development anyways).