-
Notifications
You must be signed in to change notification settings - Fork 4.8k
HIVE-29245: Normalize Java license headers, part 1 - illegal Javadoc #6125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Some indent issues will be handled by the next ticket/PR based on the comment in #6115. Or we may find a reasonable regex that replaces asf.header. |
Hi, I did the following to check this out:
The interesting thing that I experienced, that I got green checkstyle run just after those changes.
Additionally, I pushed my changes into a branch. Could you please check if I missed something in it? https://github.com/apache/hive/compare/master...InvisibleProgrammer:hive:header_checkstyle?expand=1 |
Thanks for your review!
As I mentioned, some changes are hand-maded. That's because it is overkill to write a bash script for a pattern involving only a couple of files. See the description of this PR for the details. How to reformatI ran the following script to convert
As the number of the other patterns was not so huge, everything else has been hand-maded.
You added the new check to the existing How was this patch tested?I put the following configuration on <?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>
Do you mean this change? It excludes
|
<suppress checks="RegexpHeader" files="serde\/src\/java\/org\/apache\/hadoop\/hive\/serde2\/lazy\/fast\/StringToDouble\.java"/> | ||
<suppress checks="RegexpHeader" files="llap-server\/src\/java\/org\/apache\/hadoop\/hive\/llap\/daemon\/impl\/PriorityBlockingDeque\.java"/> | ||
<!-- Generated by Avro --> | ||
<suppress checks="RegexpHeader" files="hbase-handler\/src\/test\/org\/apache\/hadoop\/hive\/hbase\/avro\/.*\.java"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EmployeeAvro.java is modified in this PR. And I see no other file that ends with avro.java.
I have one last question: what do you think? Does it make sense to set the severity level to error for this rule only? I'm thinking about this:
|
@InvisibleProgrammer As a Hive committer, I review all reports from SonarQube and don't merge pull requests with addressable issues. So, "nobody reads the warnings" doesn't apply to me. My position: SonarQube helps keep the code quality. Changing the severity per rule makes sense to me. Let me try it(it works! Thank you!). ![]() As a PR author and reviewer, I spent some time on the header issue, as well as we consumed CI resources. There are two reasons. (1) I copy and paste them from existing files. (2) The error message is a little confusing. As a PR author, I struggled to find the SonarQube's mechanism and fix them. As a reviewer, I put two comments to resolve the header issue completely (first, second). ![]() I assume each contributor no longer needs to spend human minutes + CI resources once we spend a couple of hours resolving the issue. Important points: I'm open to alternative solutions or alternative ideas(e.g., discontinue the SonarQube integration). Also, since this is not urgent or critical, I'm open to voiding this ticket or putting off reviews. We can say "checkstyle/asf.header is the source of truth" on each pull request. We can revisit here once we feel it should be addressed. |
|
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
, andstorage-api/checkstyle/checkstyle.xml. After that, I ran
mvn checkstyle:check`.How to reformat
I ran the following script to convert
\A\/\*\*$
into\A\/\\*$
.As the number of the other patterns was not so huge, everything else has been hand-maded.