[Feature][style] Add spotless maven plugin for automatic style fix.#11272
[Feature][style] Add spotless maven plugin for automatic style fix.#11272EricGao888 merged 14 commits intoapache:devfrom
Conversation
|
Actually we could keep both |
AFAIK. https://github.com/apache/shardingsphere/tree/master/src/resources Also here is a related instructions written in Chinese: https://shardingsphere.apache.org/blog/cn/material/spotless/ |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #11272 +/- ##
=========================================
Coverage 40.26% 40.26%
+ Complexity 4843 4842 -1
=========================================
Files 974 974
Lines 37323 37323
Branches 4142 4142
=========================================
Hits 15028 15028
+ Misses 20749 20748 -1
- Partials 1546 1547 +1 ☔ View full report in Codecov by Sentry. |
I've tested locally and it seems it does check the import order and fix it automatically, although I haven't figured it out how it does it. Anyway I will double check it. Thx |
|
I will update the related docs in the following commits of this PR. |
I think spotless by default sorts the imports in alphabetical order unless we want to sort in another order we don't need extra configuration maybe |
Ok, in fact, we have our own order of imports, but it's ok for me if we change to alphabetical order. |
|
For developer's convenience, I suggest setting <executions>
<execution>
<goals>
<goal>apply</goal>
</goals>
<phase>compile</phase>
</execution>
</executions>In this way, Another way is to use |
I personally used pre-commit hook in my own project and I prefer to use this. Also even we have the hook we should still keep the style check in CI because that can be skipped in developers' local machine. |
Also, developers might skip running maven compile if they develop in an IDE (mostly) |
kezhenxu94
left a comment
There was a problem hiding this comment.
Can you please also update this ?
dolphinscheduler/.github/actions/sanity-check/action.yml
Lines 34 to 53 in 8ded072
Sure, just for confirmation, I'm supposed to update this with |
Yes right |
|
Kudos, SonarCloud Quality Gate passed!
|
checkstyle file remove in #11272
* [Feature][style] Add spotless maven plugin for automatic style fix. (apache#11272) * [Feature][style] Add spotless maven plugin for automatic style fix (apache#10963) * Fix spotless ratchet configuration * Remove license-check and decrease line length threshold value * Update related docs * Remove checkstyle and add pre-commit hook * Test updated pre-commit hook * Replace checkstyle with spotless in CI * Remove reviewdog (cherry picked from commit 6a02870) * Cp spotless Co-authored-by: Eric Gao <ericgao.apache@gmail.com>








Purpose of the pull request
Brief change log
pom.xml.spotlessplugin.HEAD.Verify this pull request