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

Remove CheckStyle code formatting plugin #1362

Closed
owaiskazi19 opened this issue Oct 13, 2021 · 1 comment
Closed

Remove CheckStyle code formatting plugin #1362

owaiskazi19 opened this issue Oct 13, 2021 · 1 comment
Assignees
Labels
Build Libraries & Interfaces enhancement Enhancement or improvement to existing feature or request v1.2.0 Issues related to version 1.2.0

Comments

@owaiskazi19
Copy link
Member

owaiskazi19 commented Oct 13, 2021

Is your feature request related to a problem? Please describe.
Currently the project has two formatting tools Spotless and CheckStyle. Spotless itself can format the code and check the standard java code using spotlessApply and spotlessJavaCheck respectively. Both the plugins have different configuration for formatting which restrict us to run Spotless on all the subprojects. Removing CheckStyle will help to run a unified formatting on the codebase.

There are two code styling plugins used currently:

  1. Spotless - Provides code formatting and style checking
  2. CheckStyle - Provides style checking

OpenSearch Core had two code styling plugins Spotless and CheckStyle. Spotless itself can format the code and check the standard java code using spotlessApply and spotlessJavaCheck respectively. Both the plugins have different configuration for formatting which restricted us to run Spotless on all the subprojects. Removing CheckStyle helped to run a unified formatting on the codebase.

How plugins were using CheckStyle?

Plugins were using CheckStyle formatting plugin present in OpenSearch Core’s build.gradle. When OpenSearch decided to go with Spotless in 1.2 and removed CheckStyle plugin, it caused issue on plugins side and the build broke as CheckStyle plugin was not available to format the code on plugin side. Related issue: #1362

Reason OpenSearch decided to go with Spotless:

This was done because OpenSearch had 2 code styling plugins: Spotless and CheckStyle. Both the plugins have different configurations which created a conflict to have the same formatting over the whole codebase. Huge advantage of using Spotless over CheckStyle is in addition to check the formatting of the code it also has apply goal that fixes all the style and formatting.

Meta issue to track Spotless run: #974

Describe the solution you'd like
Remove CheckStyle plugin and use Spotless for formatting.

@owaiskazi19
Copy link
Member Author

Closes by #1370

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build Libraries & Interfaces enhancement Enhancement or improvement to existing feature or request v1.2.0 Issues related to version 1.2.0
Projects
None yet
Development

No branches or pull requests

1 participant