You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hugegraph.apache.org by "returnToInnocence (via GitHub)" <gi...@apache.org> on 2024/02/23 17:50:31 UTC
[PR] refine the hg-style.xml #2435 no indents change [incubator-hugegraph]
returnToInnocence opened a new pull request, #2457:
URL: https://github.com/apache/incubator-hugegraph/pull/2457
<!--
Thank you very much for contributing to Apache HugeGraph, we are happy that you want to help us improve it!
Here are some tips for you:
1. If this is your first time, please read the [contributing guidelines](https://github.com/apache/hugegraph/blob/master/CONTRIBUTING.md)
2. If a PR fix/close an issue, type the message "close xxx" (xxx is the link of related
issue) in the content, GitHub will auto link it (Required)
3. Name the PR title in "Google Commit Format", start with "feat | fix | perf | refactor | doc | chore",
such like: "feat(core): support the PageRank algorithm" or "fix: wrong break in the compute loop" (module is optional)
skip it if you are unsure about which is the best component.
4. One PR address one issue, better not to mix up multiple issues.
5. Put an `x` in the `[ ]` to mark the item as CHECKED. `[x]` (or click it directly after
published)
-->
## Purpose of the PR
- fix the #2435 's subtask of refine the hg-style.xml specification.<!-- or use "fix #xxx", "xxx" is the ID-link of related issue, e.g: close #1024 -->
<!--
Please explain more context in this section, clarify why the changes are needed.
e.g:
- If you propose a new API, clarify the use case for a new API.
- If you fix a bug, you can clarify why it is a bug, and should be associated with an issue.
-->
## Main Changes
<!-- Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue. These change logs are helpful for better ant faster reviews.)
For example:
- If you introduce a new feature, please show detailed design here or add the link of design documentation.
- If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
- If there is a discussion in the mailing list, please add the link. -->
- Change the maximum wrap text length for XML and Java to 120 —— hard wrap at should be set to 120.
- Add a blank line between method definitions, inner class definitions, and static code blocks —— after the anonymous class header and before the method body.
- For Properties files, add the option "KEEP_BLANK_LINES."
## Verifying these changes
<!-- Please pick the proper options below -->
- [ ] Trivial rework / code cleanup without any test coverage. (No Need)
- [ ] Already covered by existing tests, such as *(please modify tests here)*.
- [x] Need tests and can be verified as follows:
- By reformat the code modules that have completed merge at present, if there is no change, the test is successful😀
## Does this PR potentially affect the following parts?
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
- [ ] Nope
- [ ] Dependencies (add/update license info) <!-- Don't forget to add/update the info in "LICENSE" & "NOTICE" files (both in root & dist module) -->
- [ ] Modify configurations
- [ ] The public API
- [ ] Other affects (typed here)
## Documentation Status
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
- [ ] `Doc - TODO` <!-- Your PR changes impact docs and you will update later -->
- [ ] `Doc - Done` <!-- Related docs have been already added or updated -->
- [ ] `Doc - No Need` <!-- Your PR changes don't impact/need docs -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org
Re: [PR] chore: refine the hg-style.xml specification [WIP] [incubator-hugegraph]
Posted by "returnToInnocence (via GitHub)" <gi...@apache.org>.
returnToInnocence commented on PR #2457:
URL: https://github.com/apache/incubator-hugegraph/pull/2457#issuecomment-1962238567
> LGTM
Sorry, I just found a few more configuration omissions, I will mention a new commit to supplement
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org
Re: [PR] chore: refine the hg-style.xml specification [incubator-hugegraph]
Posted by "returnToInnocence (via GitHub)" <gi...@apache.org>.
returnToInnocence commented on code in PR #2457:
URL: https://github.com/apache/incubator-hugegraph/pull/2457#discussion_r1501746567
##########
.editorconfig:
##########
@@ -21,7 +21,3 @@ root = true
charset = utf-8
end_of_line = lf
insert_final_newline = true
-
-[*.{java,xml,py}]
-indent_style = space
-indent_size = 4
Review Comment:
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
![img_v3_028c_a7aac239-0ec9-4b39-bc7f-3aa42f6f1cag](https://github.com/apache/incubator-hugegraph/assets/103014488/d39d6c16-ca19-4421-89b2-c58f88cc06d7)
## After modification
![img_v3_028c_492f8f97-bc13-47a0-ba66-b4f675c0851g](https://github.com/apache/incubator-hugegraph/assets/103014488/b8905db3-b69f-4a99-acfa-b774d9488418)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org
Re: [PR] chore: refine the hg-style.xml specification [incubator-hugegraph]
Posted by "VGalaxies (via GitHub)" <gi...@apache.org>.
VGalaxies merged PR #2457:
URL: https://github.com/apache/incubator-hugegraph/pull/2457
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org
Re: [PR] chore: refine the hg-style.xml specification [incubator-hugegraph]
Posted by "javeme (via GitHub)" <gi...@apache.org>.
javeme commented on PR #2457:
URL: https://github.com/apache/incubator-hugegraph/pull/2457#issuecomment-1962229100
LGTM
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org
Re: [PR] chore: refine the hg-style.xml specification [incubator-hugegraph]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #2457:
URL: https://github.com/apache/incubator-hugegraph/pull/2457#issuecomment-1962230870
## [Codecov](https://app.codecov.io/gh/apache/incubator-hugegraph/pull/2457?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 48.27%. Comparing base [(`bc421bb`)](https://app.codecov.io/gh/apache/incubator-hugegraph/commit/bc421bb1972c9831e51c1c7e9e6704ab8df713dd?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`35e244a`)](https://app.codecov.io/gh/apache/incubator-hugegraph/pull/2457?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #2457 +/- ##
=============================================
- Coverage 66.23% 48.27% -17.96%
+ Complexity 827 272 -555
=============================================
Files 511 511
Lines 42582 42522 -60
Branches 5935 5913 -22
=============================================
- Hits 28204 20528 -7676
- Misses 11566 19673 +8107
+ Partials 2812 2321 -491
```
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/incubator-hugegraph/pull/2457?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org
Re: [PR] chore: refine the hg-style.xml specification [incubator-hugegraph]
Posted by "imbajin (via GitHub)" <gi...@apache.org>.
imbajin commented on code in PR #2457:
URL: https://github.com/apache/incubator-hugegraph/pull/2457#discussion_r1502327710
##########
hugegraph-style.xml:
##########
@@ -74,8 +73,33 @@
<option name="WRAP_LONG_LINES" value="true" />
<option name="PARAMETER_ANNOTATION_WRAP" value="1" />
<option name="ENUM_CONSTANTS_WRAP" value="2" />
+ <option name="WRAP_ON_TYPING" value="1" />
+ <option name="SOFT_MARGINS" value="100" />
+ <option name="RIGHT_MARGIN" value="100" />
+ <option name="KEEP_BLANK_LINES_IN_DECLARATIONS" value="1" />
+ <option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
+ <option name="KEEP_BLANK_LINES_BETWEEN_PACKAGE_DECLARATION_AND_HEADER" value="1" />
+ <option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="1" />
+ <option name="BLANK_LINES_AROUND_CLASS" value="1" />
<indentOptions>
<option name="SMART_TABS" value="true" />
</indentOptions>
</codeStyleSettings>
+ <codeStyleSettings language="XML">
+ <option name="RIGHT_MARGIN" value="120" />
+ <option name="WRAP_ON_TYPING" value="1" />
+ <option name="SOFT_MARGINS" value="120" />
+ </codeStyleSettings>
Review Comment:
good, set max 120 chars for `xml` is better (could avoid some bugs when format with 100)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org
Re: [PR] chore: refine the hg-style.xml specification [incubator-hugegraph]
Posted by "javeme (via GitHub)" <gi...@apache.org>.
javeme commented on code in PR #2457:
URL: https://github.com/apache/incubator-hugegraph/pull/2457#discussion_r1501742403
##########
.editorconfig:
##########
@@ -21,7 +21,3 @@ root = true
charset = utf-8
end_of_line = lf
insert_final_newline = true
-
-[*.{java,xml,py}]
-indent_style = space
-indent_size = 4
Review Comment:
not sure why delete this code?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org
Re: [PR] chore: refine the hg-style.xml specification [incubator-hugegraph]
Posted by "returnToInnocence (via GitHub)" <gi...@apache.org>.
returnToInnocence commented on code in PR #2457:
URL: https://github.com/apache/incubator-hugegraph/pull/2457#discussion_r1501746567
##########
.editorconfig:
##########
@@ -21,7 +21,3 @@ root = true
charset = utf-8
end_of_line = lf
insert_final_newline = true
-
-[*.{java,xml,py}]
-indent_style = space
-indent_size = 4
Review Comment:
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
![img_v3_028c_a7aac239-0ec9-4b39-bc7f-3aa42f6f1cag](https://github.com/apache/incubator-hugegraph/assets/103014488/d39d6c16-ca19-4421-89b2-c58f88cc06d7)
## After modification
![img_v3_028c_492f8f97-bc13-47a0-ba66-b4f675c0851g](https://github.com/apache/incubator-hugegraph/assets/103014488/b8905db3-b69f-4a99-acfa-b774d9488418)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org
Re: [PR] chore: refine the hg-style.xml specification [incubator-hugegraph]
Posted by "returnToInnocence (via GitHub)" <gi...@apache.org>.
returnToInnocence commented on code in PR #2457:
URL: https://github.com/apache/incubator-hugegraph/pull/2457#discussion_r1502617818
##########
.editorconfig:
##########
@@ -21,7 +21,3 @@ root = true
charset = utf-8
end_of_line = lf
insert_final_newline = true
-
-[*.{java,xml,py}]
-indent_style = space
-indent_size = 4
Review Comment:
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](https://github.com/spring-cloud/spring-cloud-build/blob/main/.editorconfig)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org
Re: [PR] chore: refine the hg-style.xml specification [incubator-hugegraph]
Posted by "returnToInnocence (via GitHub)" <gi...@apache.org>.
returnToInnocence commented on code in PR #2457:
URL: https://github.com/apache/incubator-hugegraph/pull/2457#discussion_r1502617818
##########
.editorconfig:
##########
@@ -21,7 +21,3 @@ root = true
charset = utf-8
end_of_line = lf
insert_final_newline = true
-
-[*.{java,xml,py}]
-indent_style = space
-indent_size = 4
Review Comment:
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
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org