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

chore: intro editorconfig-maven-plugin for verifying code style defined in .editorconfig #2591

Merged
merged 6 commits into from
Jul 17, 2024

Conversation

VGalaxies
Copy link
Contributor

@VGalaxies VGalaxies commented Jul 15, 2024

follow up #2561

  • check code style during the verify phase of the build
  • use mvn editorconfig:format for one-click code formatting

@VGalaxies VGalaxies requested a review from imbajin July 15, 2024 15:58
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jul 15, 2024
@VGalaxies VGalaxies changed the title chore: intro editorconfig-maven-plugin for validating and appling code style in .editorconfig chore: intro editorconfig-maven-plugin for validating and appling code style in .editorconfig Jul 15, 2024
@dosubot dosubot bot added the ci-cd Build or deploy label Jul 15, 2024
@VGalaxies VGalaxies marked this pull request as draft July 15, 2024 16:00
@VGalaxies VGalaxies changed the title chore: intro editorconfig-maven-plugin for validating and appling code style in .editorconfig chore: intro editorconfig-maven-plugin for validating code style in .editorconfig Jul 15, 2024
Copy link

codecov bot commented Jul 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 52.56%. Comparing base (85e0966) to head (88f5bd5).
Report is 2 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2591      +/-   ##
============================================
+ Coverage     51.31%   52.56%   +1.25%     
+ Complexity      679      586      -93     
============================================
  Files           643      643              
  Lines         53364    53364              
  Branches       7017     7017              
============================================
+ Hits          27382    28051     +669     
+ Misses        23223    22474     -749     
- Partials       2759     2839      +80     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@VGalaxies VGalaxies changed the title chore: intro editorconfig-maven-plugin for validating code style in .editorconfig chore: intro editorconfig-maven-plugin for verifying code style in .editorconfig Jul 16, 2024
@VGalaxies VGalaxies changed the title chore: intro editorconfig-maven-plugin for verifying code style in .editorconfig chore: intro editorconfig-maven-plugin for verifying code style defined in .editorconfig Jul 16, 2024
imbajin

This comment was marked as duplicate.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jul 16, 2024
Copy link
Member

@imbajin imbajin left a comment

Choose a reason for hiding this comment

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

Thanks, maybe could paste a screenshot for it?

And wonder to know if the old files break the rule, what will happen? (Stop building? Or just warn it?)

PS: The approve button was clicked by mistake and can be ignored :)

@VGalaxies
Copy link
Contributor Author

Thanks, maybe could paste a screenshot for it?

And wonder to know if the old files break the rule, what will happen? (Stop building? Or just warn it?)

PS: The approve button was pressed by mistake and can be ignored :)

In the verify phase, the code style will be checked, and if it does not comply, an error will be reported, as shown in the figure below:

image

Important: It has been found that the editorconfig-maven-plugin doesn't support Java at the moment: for now the plugin has support to enforce coding style rules for other languages such as XML and YAML. This means that options with the ij_ prefix in .editorconfig will not be applied, as these options are generic IntelliJ options and need to be used with the IDE.

  1. https://stackoverflow.com/questions/75801441/how-to-format-java-code-based-on-editorconfig-file

  2. https://intellij-support.jetbrains.com/hc/en-us/community/posts/10650008517650--Coding-style-Does-Idea-propose-a-standalone-tool-to-format-java-code-with-editorconfig

@VGalaxies VGalaxies marked this pull request as ready for review July 16, 2024 09:32
Copy link
Member

@imbajin imbajin left a comment

Choose a reason for hiding this comment

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

THX~ (Could sync to toolchain later)

@imbajin imbajin requested a review from JackyYangPassion July 17, 2024 06:58
@JackyYangPassion JackyYangPassion merged commit 73a4c9d into master Jul 17, 2024
15 of 17 checks passed
@JackyYangPassion JackyYangPassion deleted the code-style-checker branch July 17, 2024 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-cd Build or deploy lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants