Integrated: 1357: Add Oracle copyright header format check to jcheck
Zhao Song
zsong at openjdk.org
Wed Dec 11 18:19:41 UTC 2024
On Thu, 5 Dec 2024 22:43:08 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
This pull request has now been integrated.
Changeset: 67b91555
Author: Zhao Song <zsong at openjdk.org>
URL: https://git.openjdk.org/skara/commit/67b91555ad5f74651a8cc0199bc82366d269d1f8
Stats: 490 lines in 12 files changed: 481 ins; 0 del; 9 mod
1357: Add Oracle copyright header format check to jcheck
Reviewed-by: erikj
-------------
PR: https://git.openjdk.org/skara/pull/1702
More information about the skara-dev
mailing list