Skip to content

Conversation

okumin
Copy link
Contributor

@okumin okumin commented Oct 10, 2025

What changes were proposed in this pull request?

Normalize the license headers. This pull request reformats files that don't allow the following Javadoc format. FYI: The expected header file is located at checkstyle/asf.header.

^\/\*$
^( \*| \* +.*)$
^ \*\/$

Originally, I attempted to update all at once in #6115 or #6112, but it is likely to be challenging to review. So, I created a separate pull request focusing on the minimal reformat as the first step.

Why are the changes needed?

Our CI checks the license header format of new files. Some (or most) people copy and paste the header from existing Java files. Unfortunately, existing files don't share the same format, and SonarQube often reports a license issue. A reviewer has to say "you must not copy and paste the header from existing files, you must pick it up from checkstyle/asf.header.

Does this PR introduce any user-facing change?

No

How was this patch tested?

I put the following configuration on checkstyle/checkstyle.xml, standalone-metastore/checkstyle/checkstyle.xml, and storage-api/checkstyle/checkstyle.xml. After that, I ran mvn checkstyle:check`.

<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
    "-//Puppy Crawl//DTD Check Configuration 1.2//EN"
    "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
  <module name="Checker">
    <module name="RegexpHeader">
      <property name="headerFile" value="${config_loc}/asf.header.incremental"/>
      <property name="fileExtensions" value="java"/>
      <property name="multiLines" value="2"/>
    </module>
  </module>

How to reformat

I ran the following script to convert \A\/\*\*$ into \A\/\\*$.

git ls-files '*.java' | grep -v 'src/gen/thrift' | grep -v '^iceberg/' \
  | while read -r f; do
  perl -0777 -i -pe 's/\A[ \t]*\/\*\*(\R)/\/*$1/' "$f"
done

As the number of the other patterns was not so huge, everything else has been hand-maded.

Copy link

@okumin
Copy link
Contributor Author

okumin commented Oct 11, 2025

Some indent issues will be handled by the next ticket/PR based on the comment in #6115
https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=6125&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true

@okumin okumin marked this pull request as ready for review October 11, 2025 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants