Home » Eclipse Projects » Oomph » Copyright-consistency management tool question
|Re: Copyright-consistency management tool question [message #1814810 is a reply to message #1814800]
||Thu, 19 September 2019 04:09
|| Eike Stepper
Registered: July 2009
This tool analyzes files in a Git repository for correct copyright headers. By default all ".java", ".ant", "build.xml", "plugin.xml", "fragment.xml", "feature.xml", "plugin.properties",
"fragment.properties", "feature.properties", "about.properties", "build.properties", "messages.properties", "copyright.txt", ".exsd",
"org.eclipse.jdt.ui.prefs" files are analyzed in all folders of the repository. For each such file the entire Git history is iterated and date ranges are constructed to format a proper Copyright line, for example:
Copyright (c) 2008-2013, 2015, 2016 Eike Stepper (Loehne, Germany) and others.
Files with missing Copyright headers can be opened in editors after the analysis, so that you can manually add the right form of headers easily. The analysis ignores Git commits with certain verb+noun combinations , so that the commits of the analysis results themselves have no impact on the copyright headers, for example "Fix copyright headers".
Many of the default values of the analysis can be overridden with a properties file named .legalchecks in the root of the Git repo.
Unfortunately there's no proper documentation available for the small tool, so it's best to study the code: https://git.eclipse.org/c/oomph/org.eclipse.oomph.git/tree/plugins/org.eclipse.oomph.gitbash/src/org/eclipse/oomph/gitbash/repository/UpdateCopyrightsAction.java
Please note that, even though you can override the DEFAULT_COPYRIGHT_PATTERN with the "copyright.pattern" property, your custom pattern must specify the same match groups in the same order; compare https://git.eclipse.org/c/oomph/org.eclipse.oomph.git/tree/plugins/org.eclipse.oomph.gitbash/src/org/eclipse/oomph/gitbash/repository/UpdateCopyrightsAction.java#n357 ff.
I wrote this small action to automate the copyright header management of CDO. If you want to make it more flexible feel free to contribute patches ;-)
Current Time: Wed Jan 19 08:15:28 GMT 2022
Powered by FUDForum
. Page generated in 0.02483 seconds