Closed returnToInnocence closed 1 week ago
To test the correctness of the results after migrating the code format control configuration from hugegraph-style.xml
to .editorconfig
in the incubator-hugegraph project, you can follow these steps:
Code Formatting Tools Compatibility: Ensure that the tools or IDEs (Integrated Development Environments) used by the project's contributors support .editorconfig
. Most modern IDEs like IntelliJ IDEA, Eclipse, and Visual Studio Code have built-in support or plugins available for .editorconfig
.
Automated Formatting Check: Implement a CI (Continuous Integration) pipeline step that checks if the code conforms to the .editorconfig
settings. This can be achieved by using tools like checkstyle
for Java, which can be configured to use .editorconfig
directly or through plugins. For example, the eclipse-cs
plugin allows Checkstyle to work with .editorconfig
.
Manual Review and Testing:
Community Feedback: Encourage the project contributors to pull the latest changes and report any issues or unexpected changes in code formatting. This feedback can be invaluable in identifying edge cases or configurations that may have been overlooked.
Documentation: Update the project's documentation to inform contributors about the migration to .editorconfig
and how they can configure their IDEs or editors to adhere to the new formatting rules.
By following these steps, you can systematically test and ensure the correctness of the results after migrating to .editorconfig
for code formatting in the incubator-hugegraph project.
Regarding the structure of the hugegraph-style.xml
file in the incubator-hugegraph project, it provides a comprehensive set of configurations for code styling, particularly focusing on Java, XML, and YAML languages, ensuring consistency and readability across the project's codebase. You can reference this structure when creating your .editorconfig
file to ensure that all necessary formatting rules are covered.
For more details, you can refer to the .editorconfig
file and the hugegraph-style.xml
file in the incubator-hugegraph project.
I hope this helps! If you have any further questions, feel free to ask.
-Dosu
Hi everyone, I wondered if anyone is working on this issue? I'd like to have a try on it.
Hi everyone, I wondered if anyone is working on this issue? I'd like to have a try on it.
No one is working on this issue currently. I've assigned it to you~
Hi everyone, I wondered if anyone is working on this issue? I'd like to have a try on it.
Hi @FrostyHec, If you encounter any problems, please feel free to @ me😁
@returnToInnocence Thanks~, I would like to inquire if there are some code format requirement for markdown? I see the style requirements for markdown in hugegraph-style.xml in not defined, and the default code format style exported by IDEA is this:
[{*.markdown,*.md}]
ij_visual_guides =
ij_markdown_force_one_space_after_blockquote_symbol = true
ij_markdown_force_one_space_after_header_symbol = true
ij_markdown_force_one_space_after_list_bullet = true
ij_markdown_force_one_space_between_words = true
ij_markdown_format_tables = true
ij_markdown_insert_quote_arrows_on_wrap = true
ij_markdown_keep_indents_on_empty_lines = false
ij_markdown_keep_line_breaks_inside_text_blocks = true
ij_markdown_max_lines_around_block_elements = 1
ij_markdown_max_lines_around_header = 1
ij_markdown_max_lines_between_paragraphs = 1
ij_markdown_min_lines_around_block_elements = 1
ij_markdown_min_lines_around_header = 1
ij_markdown_min_lines_between_paragraphs = 1
ij_markdown_wrap_text_if_long = true
ij_markdown_wrap_text_inside_blockquotes = true
@returnToInnocence Thanks~, I would like to inquire if there are some code format requirement for markdown? I see the style requirements for markdown in hugegraph-style.xml in not defined, and the default code format style exported by IDEA is this: 谢谢~,我想问一下markdown有没有代码格式要求?我看到hugegraph-style.xml中markdown的样式要求没有定义,IDEA导出的默认代码格式样式是这样的:
[{*.markdown,*.md}] ij_visual_guides = ij_markdown_force_one_space_after_blockquote_symbol = true ij_markdown_force_one_space_after_header_symbol = true ij_markdown_force_one_space_after_list_bullet = true ij_markdown_force_one_space_between_words = true ij_markdown_format_tables = true ij_markdown_insert_quote_arrows_on_wrap = true ij_markdown_keep_indents_on_empty_lines = false ij_markdown_keep_line_breaks_inside_text_blocks = true ij_markdown_max_lines_around_block_elements = 1 ij_markdown_max_lines_around_header = 1 ij_markdown_max_lines_between_paragraphs = 1 ij_markdown_min_lines_around_block_elements = 1 ij_markdown_min_lines_around_header = 1 ij_markdown_min_lines_between_paragraphs = 1 ij_markdown_wrap_text_if_long = true ij_markdown_wrap_text_inside_blockquotes = true
@FrostyHec
In PR:https://github.com/apache/incubator-hugegraph/pull/2525(You can see its detailed description), max line length = off
This configuration is recommended to be retained, This configuration is expected to do the following for idea (to temporarily ignore the poor visual effects caused by the forced line breaks in .md
files):
Without this configuration, there are several possible problems with code format:
Because it's just mechanical truncation + newline (without adding two Spaces at the end of the truncation, it's not markdown newline syntax), it should not be rendered into a newline in most markdown rendering engines, but in typora and other rendering engines that support non-strict mode, it will cause the text to be rendered into a newline
@returnToInnocence
Thanks for your detailed reply~. I see mention in the issue that says "Add code format style for .md
" , and wondered if it is required to add some addtional code style for .md
after max line length = off
?
@returnToInnocence Thanks for your detailed reply~. I see mention in the issue that says "Add code format style for
.md
" , and wondered if it is required to add some addtional code style for.md
aftermax line length = off
?谢谢您详细的回复~。我在问题中看到提到“为.md
添加代码格式样式”,并想知道是否需要在max line length = off
添加一些附加代码样式> ?
@FrostyHec Thank you for identifying this issue🫡. Based on previous research, I have tentatively come to the conclusion that there does not seem to be a strong need for separate formatting of markdown files.
which means that the "What need to do" mentioned in my previous issue is not reasonable😭.
By investigating the .md
file format of several outstanding apache projects with high star counts, it is found that there are few separate formats for .md
in apache projects. (It is only noticed that most apache projects use trim_trailing_whitespace = false
and insert_final_newline = false
. But in fact, these two configurations are a common configuration for all files and you don't need to handle the .md
file separately.)
@returnToInnocence Thanks for your nice reply (⌒ω⌒) ~
Background
While working on #2457, we noticed that we were using both
hugegraph-style.xml
and.editorconfig
to control the style of our code, so we wanted to try combining the functionality of these two files into a single fileFeature Description
.editorconfig
Some advantages
.editorconfig
file can define coding conventions that cannot be defined byhg-style.xml
, such asinsert_final_newline
.editorconfig
file does not require the user to make any additional configuration, such as importing code style. If this file exists in the project, it will be automatically invoked by default, and code sytle will be overwrittenWhat need to do
hg-style.xml
to.editorconfig
https://github.com/apache/incubator-hugegraph/pull/2561Add code format style for(The reason for the removal is that there is currently no special formatting requirement for markdown files within the apache project).md
Reference
How do I test the correctness of the results