RFR: 1357: Add Oracle copyright header format check to jcheck [v2]
Erik Joelsson
erikj at openjdk.org
Tue Dec 10 13:55:42 UTC 2024
On Fri, 6 Dec 2024 08:41:31 GMT, Magnus Ihse Bursie <ihse at openjdk.org> wrote:
>> jcheck/src/main/java/org/openjdk/skara/jcheck/CopyrightCheck.java line 67:
>>
>>> 65: var copyrightFound = false;
>>> 66: for (String line : lines) {
>>> 67: if (line.contains("Copyright (c)") && line.contains("Oracle")) {
>>
>> I think it would be nice if we could work with pairs of regular expressions. One for identifying a line that should match and one that verifies the format. This way we could make it possible to add more variants through configuration.
>>
>> We could also consider not having any default and put the Oracle config in .jcheck/conf.
>
> I'm not sure its better to have Oracle in the configuration file. It kind of just highlights it as a special case. If/when some other company requests special copyright checks, then we can generalize and move it to the configuration file. Also, it's never the case that this is just a per-repo setting: for Oracle-copyrighted code, this rule always applies.
I don't want defaults because once we set them, we have to live with them. Changing the default configuration is risky as it applies globally to all commits that have already been checked as well. I think it's generally a better design having the configuration in the affected repo for increased transparency on what is actually being checked.
-------------
PR Review Comment: https://git.openjdk.org/skara/pull/1702#discussion_r1878137052
More information about the skara-dev
mailing list