Skip to content
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

ARROW-1827: [Java] Add checkstyle file and license template #1326

Closed
wants to merge 4 commits into from

Conversation

icexelloss
Copy link
Contributor

No description provided.

@icexelloss
Copy link
Contributor Author


To completely disable a check, just comment it out or delete it from the file.

Authors: Max Vetrenko, Ruslan Diachenko, Roman Ivanov.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is pretty annoying. checkstyle is LGPL which means this file cannot simply be copy-and-pasted from the checkstyle project (https://www.apache.org/legal/resolved.html#category-x) . Can we find a checkstyle.xml that implements the Google Java style from somewhere else that is ASF-compatible for inclusion here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like that file was also copied from the checkstyle project. I am looking at git histories for these files to try to determine the IP origin.

Kudu has this file, but it looks like it also came directly out of checkstyle https://github.com/apache/kudu/blob/master/java/kudu_style.xml. cc @jdcryans

looks like we can use the one from Apache Beam, we might want to review that it's the style that we expect (e.g. import order, etc.)

https://github.com/apache/beam/blob/a6f460fe3b760aafbc748ae18956f0f2c1fedfad/sdks/java/build-tools/src/main/resources/beam/checkstyle.xml

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems most "google_checks.xml" on the internet are from checkstyle project. Although some ASF licensed projects are using it and/or re license it under ASF license?

To be on the safe side, we could use the checkstyle from beam and make changes if we have to. I can look into that.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we decided it was OK because the checkstyle xml doesn't end up linked into any resulting binaries, etc -- similar how it's OK to rely on GPL or LGPL build tools in a project. I do recall finding some precedent in other Apache projects or legal resolutions, but can't find it now looking back at my email.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. It looks like we can use the Beam file and avoid the issue altogether, but it would be good to have the definitive judgment from ASF legal

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am actually leaning towards using google_checks.xml if possible. The beam file seems to be somewhat different of the google checks, which seems to be more widely used and probably is easier to find an IDE codestyle config for.

Some other ASF project, such as Spark, also seems to be using google checks:

https://github.com/apache/spark/blob/master/dev/checkstyle.xml

@wesm Is it possible to consult with ASF legal?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With both Spark and Kudu using the checkstyle as is, I think it's OK to include. If the issue comes up later we can revisit. Thanks for looking into this

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want to be pedantic on this issue, we should ensure that the file does not end up in the source tarballs. As we are using git archive to create the final tarballs, it should be sufficent to add an entry to .gitattrbutes:

/java/checkstyle/checkstyle.xml export-ignore

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank @xhochy! I added .gitattribtues

@wesm wesm changed the title [ARROW-1827] [Java] Add checkstyle file and license template ARROW-1827: [Java] Add checkstyle file and license template Nov 16, 2017
@icexelloss
Copy link
Contributor Author

I re-added checkstyle.xml file from checkstyle project.

I verified checkstyle works as expected and git archive doesn't include the checkstyle files.

This should be good to go.

Copy link
Member

@wesm wesm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, thanks @icexelloss! Let's see if we can hustle to get the style cleaned up, but first we should probably merge @BryanCutler patch

@wesm wesm closed this in 37214ef Nov 18, 2017
@wesm wesm deleted the ARROW-1827 branch November 18, 2017 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants