-
Notifications
You must be signed in to change notification settings - Fork 520
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: refine the hg-style.xml specification #2457
chore: refine the hg-style.xml specification #2457
Conversation
LGTM |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2457 +/- ##
============================================
+ Coverage 66.23% 66.30% +0.07%
Complexity 827 827
============================================
Files 511 511
Lines 42582 42622 +40
Branches 5935 5947 +12
============================================
+ Hits 28204 28262 +58
+ Misses 11566 11548 -18
Partials 2812 2812 ☔ View full report in Codecov by Sentry. |
@javeme |
…nting 8 to 4 problem
|
||
[*.{java,xml,py}] | ||
indent_style = space | ||
indent_size = 4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure why delete this code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry sir, I didn't describe this clearly in main change
The reason for this change is that we encountered a problem while formatting the java code,
The intended effect of format is to automatically wrap and indent a line when it exceeds the maximum length of 100, which is a special case where the number of indented Spaces is eight
If the changes in the.editorConfig do not change, the indentation will change to 4, even though the code style has been set to 8
Before modification
After modification
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry, but I've found a new solution that doesn't require deleting the above, but instead enables a special option in.editorconfig
for indenting more than the maximum line wrap of a single character
I'll make a new commit, which will undo my changes to the.editorconfig
section and add the options above
Mainly refer to the configuration of the spring-cloud project
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM almost
<codeStyleSettings language="XML"> | ||
<option name="RIGHT_MARGIN" value="120" /> | ||
<option name="WRAP_ON_TYPING" value="1" /> | ||
<option name="SOFT_MARGINS" value="120" /> | ||
</codeStyleSettings> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good, set max 120 chars for xml
is better (could avoid some bugs when format with 100)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GREAAAAAAAT! Looking forward to further improvements...
- Change the maximum wrap text length for XML to 120 (via `hg-style.xml`) - Add a blank line between method definitions, inner class definitions, and static code blocks (via `hg-style.xml`) - Add `<p>` tags to Javadoc blank lines (via `hg-style.xml`) - `.xml` file leaves a blank line at the end (via `.editorconfig`) - Class declaration requires a blank line before and after each line (via `hg-style.xml`) - Javadoc line comment not in line (via `hg-style.xml`) - `.properties` file leaves empty lines (via `hg-style.xml`) - `.yaml` file braces `{}`, brackets `[]` remove spaces (via `hg-style.xml`)
Purpose of the PR
Main Changes
hg-style.xml
)hg-style.xml
)hg-style.xml
)<p>
tags to JavaDoc blank lines (implemented throughhg-style.xml
).xml
file leaves a blank line at the end (through.editorconfig
)hg-style.xml
)hg-style.xml
).properties
file leaves empty lines (implemented viahg-style.xml
).yaml
file braces{}
, brackets[]
remove spacing Spaces (implemented viahg-style.xml
)Verifying these changes
Does this PR potentially affect the following parts?
However, you need to use the
ctrl+C
shortcut to enable the.editorconfig
profile in addition to the reformat code option🙈Documentation Status
Doc - TODO
Doc - Done
Doc - No Need