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-3588: [Java] Fix checkstyle for header license #2816

Conversation

BryanCutler
Copy link
Member

Enable style check for header to check the Apache license

@BryanCutler
Copy link
Member Author

There was enough discrepancy in different forms of the license header, I only enable that one check here. Could those interested, check the format of the license in dev/checkstyle.license and make sure that is what we want to go with? cc @jacques-n @icexelloss @pravindra

@@ -1,11 +1,13 @@
/*
* Portions Copyright (C) 2017-2018 Dremio Corporation
Copy link
Member Author

Choose a reason for hiding this comment

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

@jacques-n this conflicted with the style check. Here I moved it down to a separate comment to get the check to pass, but let me know how you would like to format it. Alternatively, I think we could define a RegexHeader rule that allows for an optional first line.

Copy link
Member Author

Choose a reason for hiding this comment

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

on second thought, it's probably easiest to just suppress the check for these 2 files and keep them as they were

@BryanCutler
Copy link
Member Author

BryanCutler commented Oct 23, 2018

Just for comparison, here are the different variations of the license that I found:

  1. This is the current expected format from our checkstyle
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements.  See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership.  The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License.  You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
  1. Saw this a couple times, similar to 1 but one less line and link is indented
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
  1. This was very common, same as 1 but had <p> instead of empty lines
/**
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*******************************************************************************

 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 ******************************************************************************/
  1. same as 3 but comment block starts with only one asterisk /*

@BryanCutler
Copy link
Member Author

Currently, these changes follow (1) from above, but I actually prefer (2) since it is less lines and looks a bit neater. So I don't mind changing it again. What do others think?

@icexelloss
Copy link
Contributor

I am fine with either

@wesm
Copy link
Member

wesm commented Oct 23, 2018

#2 is more similar to the license headers used elsewhere. Either way is OK to me

@BryanCutler
Copy link
Member Author

I updated the license to match (2) from above

@BryanCutler
Copy link
Member Author

Hmm, I think it should not have javadoc style /** and single /* instead. Let me fix that..

@BryanCutler
Copy link
Member Author

Ok, I think this is 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

@wesm wesm closed this in 73d379f Oct 24, 2018
@BryanCutler
Copy link
Member Author

Thanks @wesm and @icexelloss !

@BryanCutler BryanCutler deleted the java-checkstyle-license-ARROW-3588 branch November 19, 2018 05:47
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.

3 participants