Keep existing copyright lines, use template for default #309
Labels
in:core
MLP core module
is:feature
New feature
todo
Accepted items from the backlog which can be worked on
Software copyright statements are not always as consistent across all files as this plugin assumes, and there is no facility provided to permit different years or different authors other than the few provided substitutions (inception, file creation, latest change).
In order to use this plugin, maintainers are forced to adopt some text that applies to everyone, e.g., "Copyright 2020 the original author or authors" or in one project I maintain, a link to the Github "contributors" page. But in another project I maintain, the convention is for the original author of a file to provide the copyright, e.g., one file might have
And another file might have
And perhaps on a third file
(All with the boilerplate license text surrounding the copyright statement.)
A project which chooses to use the above format/policy has no way to effectively use this plugin. However, there is no need to be so strict. License header templates all use the general format:
Currently the plugin has special treatment for the first and last lines, and there's an open PR (#243) to handle middle lines that could, in theory and with a lot of effort, be configured to handle this use case. However, given the commonality across all licence headers (the copyright line is always on its own line) it should be easy to identify just that line using a well known regex (the word Copyright in between carriage returns). The document and the header template could both be tokenized to compare the 3 "stuff" categories shown above, with the following caveat: When no header exists at all, the template would fill in the copyright line; when a header exists containing the word Copyright in between CRs, it would be left completely alone.
I'm willing to submit a PR for this if there is interest.
Let me know which you'd prefer, if there is interest.
The text was updated successfully, but these errors were encountered: