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

Add license header check/fix using spotless #51

Merged
merged 2 commits into from
Jul 15, 2022
Merged

Add license header check/fix using spotless #51

merged 2 commits into from
Jul 15, 2022

Conversation

dbwiddis
Copy link
Member

Signed-off-by: Daniel Widdis [email protected]

Description

Uses the licenseHeader feature of spotless to apply a license header.

WIthout proper headers, build will fail:

> Task :spotlessLicenseCheck FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':spotlessLicenseCheck'.
> The following files had format violations:
      src/main/java/org/opensearch/sdk/ActionListener.java
          @@ -5,7 +5,6 @@
           ·*·this·file·be·licensed·under·the·Apache-2.0·license·or·a
           ·*·compatible·open·source·license.
           ·*/
          -
           package·org.opensearch.sdk;
           
           import·org.opensearch.common.SuppressForbidden;
      src/main/java/org/opensearch/sdk/ClusterSettingsResponseHandler.java
          @@ -1,3 +1,10 @@
          +/*
          +·*·SPDX-License-Identifier:·Apache-2.0
          +·*

... snip ...

      src/main/java/org/opensearch/sdk/ExtensionsRunner.java
          @@ -4,11 +4,7 @@
           ·*·The·OpenSearch·Contributors·require·contributions·made·to
           ·*·this·file·be·licensed·under·the·Apache-2.0·license·or·a
      ... (9 more lines that didn't fit)
  Violations also present in:
      src/main/java/org/opensearch/sdk/LocalNodeResponseHandler.java
  Run './gradlew :spotlessApply' to fix these violations.

As suggested, ./gradlew spotlessApply fixes the problem (and is how all the changed files were generated).

Netty4 package is excluded from this check (reviewers: should it be?)

Issues Resolved

Fixes #50

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@dbwiddis dbwiddis requested review from a team, owaiskazi19 and saratvemulapalli July 14, 2022 19:06
owaiskazi19
owaiskazi19 previously approved these changes Jul 14, 2022
peternied
peternied previously approved these changes Jul 14, 2022
@dbwiddis dbwiddis dismissed stale reviews from peternied and owaiskazi19 via 1704412 July 14, 2022 21:43
@dbwiddis dbwiddis merged commit 940c647 into opensearch-project:main Jul 15, 2022
@dbwiddis dbwiddis deleted the license-plugin branch July 15, 2022 04:15
@dbwiddis dbwiddis mentioned this pull request Oct 13, 2022
kokibas pushed a commit to kokibas/opensearch-sdk-java that referenced this pull request Mar 17, 2023
* Add license header check/fix using spotless

Signed-off-by: Daniel Widdis <[email protected]>

* Remove extra white space and end with newline

Signed-off-by: Daniel Widdis <[email protected]>
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.

[FEATURE] Integrate license check plugin
4 participants