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

Adding Spotless support framework #1888

Merged
merged 8 commits into from
Jul 24, 2023

Conversation

MitchellGale
Copy link
Contributor

@MitchellGale MitchellGale commented Jul 20, 2023

Description

Adds support for Spotless code formatter via ./gradlew spotlessApply and ./gradlew spotlessCheck. Apply applies the checks, check notifies which changes need to be applied.

Proposed checks commented out:
License header
Import order - sorts imports
Remove unused imports
Trim trailing whitespace
End with newline
Google Java format - https://github.com/google/google-java-format

Note: proposed spotless checks will be commented out until fix for each individual is merged. Lines will be uncommented as part of PRs addressing change.

Issues Resolved

#1101

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented.
    • New functionality has javadoc added
    • New functionality has user manual doc added
  • Commits are signed per the DCO using --signoff

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.

MitchellGale and others added 8 commits July 19, 2023 23:32
Signed-off-by: Mitchell Gale <[email protected]>

Remove commented out spotless changes.

Signed-off-by: Mitchell Gale <[email protected]>

Adding Spotless to DEVELOPER_GUIDE.rst

Signed-off-by: Mitchell Gale <[email protected]>

Added Google Java format to spotless.

Signed-off-by: Mitchell Gale <[email protected]>

Update DEVELOPER_GUIDE.rst

Co-authored-by: Yury-Fridlyand <[email protected]>
Signed-off-by: Mitchell Gale <[email protected]>
Signed-off-by: Mitchell Gale <[email protected]>
@Yury-Fridlyand Yury-Fridlyand merged commit af12c02 into opensearch-project:main Jul 24, 2023
@Yury-Fridlyand Yury-Fridlyand deleted the integ/spotless branch July 24, 2023 18:54
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.x 2.x
# Navigate to the new working tree
cd .worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-1888-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 af12c028270a927474774808a1710a82c3b5c0a7
# Push it to GitHub
git push --set-upstream origin backport/backport-1888-to-2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-1888-to-2.x.

MitchellGale added a commit to Bit-Quill/opensearch-project-sql that referenced this pull request Jul 26, 2023
* Adding spotless plugin to project build.gradle.

Signed-off-by: Mitchell Gale <[email protected]>

Remove commented out spotless changes.

Signed-off-by: Mitchell Gale <[email protected]>

Adding Spotless to DEVELOPER_GUIDE.rst

Signed-off-by: Mitchell Gale <[email protected]>

Added Google Java format to spotless.

Signed-off-by: Mitchell Gale <[email protected]>

Update DEVELOPER_GUIDE.rst

Co-authored-by: Yury-Fridlyand <[email protected]>

* Added apply false for spotless

Signed-off-by: Mitchell Gale <[email protected]>

* Adding ratchetFrom to build.gradle

Signed-off-by: Mitchell Gale <[email protected]>

* Adding license header to build.gradle for spotless.

Signed-off-by: Mitchell Gale <[email protected]>

* Uncommenting all changes to build.gradle for spotless.

Signed-off-by: Mitchell Gale <[email protected]>

* Commented out spotless checks.

Signed-off-by: Mitchell Gale <[email protected]>

* Add specific version for java format spotless (1.17.0)

Signed-off-by: Mitchell Gale <[email protected]>

---------

Signed-off-by: Mitchell Gale <[email protected]>
Co-authored-by: Yury-Fridlyand <[email protected]>
Signed-off-by: Mitchell Gale <[email protected]>
GumpacG added a commit that referenced this pull request Jul 27, 2023
[Backport 2.x] Adding Spotless support framework #1888
MitchellGale added a commit to Bit-Quill/opensearch-project-sql that referenced this pull request Jul 28, 2023
* Adding spotless plugin to project build.gradle.

Signed-off-by: Mitchell Gale <[email protected]>

Remove commented out spotless changes.

Signed-off-by: Mitchell Gale <[email protected]>

Adding Spotless to DEVELOPER_GUIDE.rst

Signed-off-by: Mitchell Gale <[email protected]>

Added Google Java format to spotless.

Signed-off-by: Mitchell Gale <[email protected]>

Update DEVELOPER_GUIDE.rst

Co-authored-by: Yury-Fridlyand <[email protected]>

* Added apply false for spotless

Signed-off-by: Mitchell Gale <[email protected]>

* Adding ratchetFrom to build.gradle

Signed-off-by: Mitchell Gale <[email protected]>

* Adding license header to build.gradle for spotless.

Signed-off-by: Mitchell Gale <[email protected]>

* Uncommenting all changes to build.gradle for spotless.

Signed-off-by: Mitchell Gale <[email protected]>

* Commented out spotless checks.

Signed-off-by: Mitchell Gale <[email protected]>

* Add specific version for java format spotless (1.17.0)

Signed-off-by: Mitchell Gale <[email protected]>

---------

Signed-off-by: Mitchell Gale <[email protected]>
Co-authored-by: Yury-Fridlyand <[email protected]>
Signed-off-by: Mitchell Gale <[email protected]>
MitchellGale added a commit to Bit-Quill/opensearch-project-sql that referenced this pull request Jul 28, 2023
* Adding spotless plugin to project build.gradle.

Signed-off-by: Mitchell Gale <[email protected]>

Remove commented out spotless changes.

Signed-off-by: Mitchell Gale <[email protected]>

Adding Spotless to DEVELOPER_GUIDE.rst

Signed-off-by: Mitchell Gale <[email protected]>

Added Google Java format to spotless.

Signed-off-by: Mitchell Gale <[email protected]>

Update DEVELOPER_GUIDE.rst

Co-authored-by: Yury-Fridlyand <[email protected]>

* Added apply false for spotless

Signed-off-by: Mitchell Gale <[email protected]>

* Adding ratchetFrom to build.gradle

Signed-off-by: Mitchell Gale <[email protected]>

* Adding license header to build.gradle for spotless.

Signed-off-by: Mitchell Gale <[email protected]>

* Uncommenting all changes to build.gradle for spotless.

Signed-off-by: Mitchell Gale <[email protected]>

* Commented out spotless checks.

Signed-off-by: Mitchell Gale <[email protected]>

* Add specific version for java format spotless (1.17.0)

Signed-off-by: Mitchell Gale <[email protected]>

---------

Signed-off-by: Mitchell Gale <[email protected]>
Co-authored-by: Yury-Fridlyand <[email protected]>
Signed-off-by: Mitchell Gale <[email protected]>
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.

6 participants