RFR: 1357: Add Oracle copyright header format check to jcheck [v4]
Zhao Song
zsong at openjdk.org
Tue Dec 10 21:36:32 UTC 2024
> 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
-------------
Changes:
- all: https://git.openjdk.org/skara/pull/1702/files
- new: https://git.openjdk.org/skara/pull/1702/files/2e639463..e1ee94d6
Webrevs:
- full: https://webrevs.openjdk.org/?repo=skara&pr=1702&range=03
- incr: https://webrevs.openjdk.org/?repo=skara&pr=1702&range=02-03
Stats: 31 lines in 1 file changed: 0 ins; 22 del; 9 mod
Patch: https://git.openjdk.org/skara/pull/1702.diff
Fetch: git fetch https://git.openjdk.org/skara.git pull/1702/head:pull/1702
PR: https://git.openjdk.org/skara/pull/1702
More information about the skara-dev
mailing list