RFR: 1357: Add Oracle copyright header format check to jcheck [v4]

Zhao Song zsong at openjdk.org
Wed Dec 11 18:19:41 UTC 2024


On Tue, 10 Dec 2024 21:36:32 GMT, Zhao Song <zsong at openjdk.org> wrote:

>> This patch introduces a copyright format jcheck.
>> For pull requests, this check checks the format of copyright header in all modified files(if the file name matches the regex in .jcheck/conf)
>> 
>> To enable the new copyrightFormat jcheck, proper configurations are needed in .jcheck/conf. A locator, a validator are needed in the .jcheck/conf file. The locator is only used to locate the copyright line, so the regex is easier to match. If the locator could find the copyright line, then validator will be used to validate the format of the line. There is also an optional parameter "required", it indicates whether a copyright is required for each file, if true, the check will fail if the copyright is missing.
>> 
>> For example, if we want to enable a copyright format check for oracle.
>> We can define the configuration like this 
>> 
>> oracle_locator=.*Copyright (c)(.*)Oracle and/or its affiliates. All rights reserved.
>> oracle_validator=.*Copyright (c) (\d{4})(?:, (\d{4}))?, Oracle and/or its affiliates. All rights reserved. 
>> oracle_required=true
>
> Zhao Song has updated the pull request incrementally with one additional commit since the last revision:
> 
>   make CopyrightConfiguration a record

Thank you all for comments and reviews!

-------------

PR Comment: https://git.openjdk.org/skara/pull/1702#issuecomment-2536785252


More information about the skara-dev mailing list