You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Summary] Enhance code style warnings in server #2435
I'm sorry, but I'm unable to view the images you've attached. However, I can provide some general advice on why the server module might be triggering warnings when using check-style.
The server module might trigger warnings due to several reasons:
Line Length: The recommended line length is less than or equal to 100 characters. If the code in the server module exceeds this limit, it will trigger a warning.
Alignment and Indentation: The code style guide suggests that for strings and function parameters, alignment has a higher priority than indentation. If the code in the server module doesn't follow this rule, it will trigger a warning.
Empty Lines: The code style guide specifies certain situations where an empty line should be added. If the code in the server module doesn't follow these rules, it will trigger a warning.
Variable and Method Naming: The code style guide suggests using camel case for variable and method naming, and method names should not have get, set, is prefixes. If the code in the server module doesn't follow these rules, it will trigger a warning.
Error Checking: The code style guide suggests using E.checkArgument() and E.checkState() for error checking instead of if + throw. If the code in the server module doesn't follow this rule, it will trigger a warning.
Exception Handling: The code style guide suggests handling exceptions at the top-level call or external API call. If the code in the server module doesn't follow this rule, it will trigger a warning.
Logging: The code style guide suggests using {} for placeholders in log messages instead of string concatenation. If the code in the server module doesn't follow this rule, it will trigger a warning.
String Concatenation: The code style guide suggests using String.format() for string concatenation. If the code in the server module doesn't follow this rule, it will trigger a warning.
Please check the server module code against these rules to identify the specific cause of the warnings. You can refer to the Hugegraph Code Style Guide for more details.
Without the specific warnings or the exact lines of code that are causing these warnings, it's difficult to provide a more precise answer. If you could provide more details about the warnings, such as the warning messages or the lines of code that are causing these warnings, I would be able to provide a more accurate response.
Review whether hugegraph-style.xml aligns with the specifications outlined in the HugeGraph Code Style Guide.
Import the latest license header (found at the end of the HugeGraph Code Style Guide) into IDEA and utilize the "Update Copyright" feature to keep the license header up-to-date.
Utilize IDEA plugins such as Reformat and Clean Code for code formatting.
Suddenly a new idea, perhaps as a future thing to do, is to try to migrate the entire contents of the entire hg-style.xml file to.editorconfig
This is because the.editorconfig file has some other advantages that hg-style.xml does not have when I was looking at the documentation for this, such as:
The.editorconfig file can also define coding conventions that cannot be defined by hg-style.xml, such as code style, formatting, and naming, which can help improve code consistency and readability.
The.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 overwritten
Therefore, I wonder if we should further try to gather the configuration of a function as much as possible in the future, instead of spreading it into multiple Settings, and reduce the user's perception of format as little as possible at one time
Suddenly a new idea, perhaps as a future thing to do, is to try to migrate the entire contents of the entire hg-style.xml file to.editorconfig
This is because the.editorconfig file has some other advantages that hg-style.xml does not have when I was looking at the documentation for this, such as:
The.editorconfig file can also define coding conventions that cannot be defined by hg-style.xml, such as code style, formatting, and naming, which can help improve code consistency and readability.
The.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 overwritten
Therefore, I wonder if we should further try to gather the configuration of a function as much as possible in the future, instead of spreading it into multiple Settings, and reduce the user's perception of format as little as possible at one time
Indeed, I found that #2457 uses both hugegraph-style.xml and .editorconfig to control code style. If the control scope of the editorconfig file is broader than the idea code style XML, it might be worth considering consolidating them into .editorconfig.
Perhaps it's possible to export the current hugegraph-style.xml to .editorconfig format and merge it with the existing .editorconfig to see if the previously defined styles are compromised...
Suddenly a new idea, perhaps as a future thing to do, is to try to migrate the entire contents of the entire hg-style.xml file to.editorconfig
This is because the.editorconfig file has some other advantages that hg-style.xml does not have when I was looking at the documentation for this, such as:
The.editorconfig file can also define coding conventions that cannot be defined by hg-style.xml, such as code style, formatting, and naming, which can help improve code consistency and readability.
The.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 overwritten
Therefore, I wonder if we should further try to gather the configuration of a function as much as possible in the future, instead of spreading it into multiple Settings, and reduce the user's perception of format as little as possible at one time
Indeed, I found that #2457 uses both hugegraph-style.xml and .editorconfig to control code style. If the control scope of the editorconfig file is broader than the idea code style XML, it might be worth considering consolidating them into .editorconfig.
Perhaps it's possible to export the current hugegraph-style.xml to .editorconfig format and merge it with the existing .editorconfig to see if the previously defined styles are compromised...
get it! I will try to export it this afternoon to see how it works!
Activity
dosubot commentedon Jan 31, 2024
🤖
I'm sorry, but I'm unable to view the images you've attached. However, I can provide some general advice on why the
servermodule might be triggering warnings when usingcheck-style.The
servermodule might trigger warnings due to several reasons:Line Length: The recommended line length is less than or equal to 100 characters. If the code in the
servermodule exceeds this limit, it will trigger a warning.Alignment and Indentation: The code style guide suggests that for strings and function parameters, alignment has a higher priority than indentation. If the code in the
servermodule doesn't follow this rule, it will trigger a warning.Empty Lines: The code style guide specifies certain situations where an empty line should be added. If the code in the
servermodule doesn't follow these rules, it will trigger a warning.Variable and Method Naming: The code style guide suggests using camel case for variable and method naming, and method names should not have get, set, is prefixes. If the code in the
servermodule doesn't follow these rules, it will trigger a warning.Error Checking: The code style guide suggests using
E.checkArgument()andE.checkState()for error checking instead ofif+throw. If the code in theservermodule doesn't follow this rule, it will trigger a warning.Exception Handling: The code style guide suggests handling exceptions at the top-level call or external API call. If the code in the
servermodule doesn't follow this rule, it will trigger a warning.Logging: The code style guide suggests using
{}for placeholders in log messages instead of string concatenation. If the code in theservermodule doesn't follow this rule, it will trigger a warning.String Concatenation: The code style guide suggests using
String.format()for string concatenation. If the code in theservermodule doesn't follow this rule, it will trigger a warning.Please check the
servermodule code against these rules to identify the specific cause of the warnings. You can refer to the Hugegraph Code Style Guide for more details.Without the specific warnings or the exact lines of code that are causing these warnings, it's difficult to provide a more precise answer. If you could provide more details about the warnings, such as the warning messages or the lines of code that are causing these warnings, I would be able to provide a more accurate response.
Sources
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
If you want to continue the conversation, start your reply with @dosu-bot.
[-][Bug] Checkstyle warnings in server[/-][+][Bug] Compile warnings in server[/+][-][Bug] Compile warnings in server[/-][+][Enhancement] Fix check-style compile warnings in server[/+]VGalaxies commentedon Feb 2, 2024
@msgui consider introducing the specific steps for formatting, cleaning, and correcting in the relevant PRs to help us in PR validation :)
[-][Enhancement] Fix check-style compile warnings in server[/-][+][Summary] Enhance code style warnings in server[/+]msgui commentedon Feb 3, 2024
Configure IDEA based on the Config Style full version - fs.
Review whether hugegraph-style.xml aligns with the specifications outlined in the HugeGraph Code Style Guide.
Import the latest license header (found at the end of the HugeGraph Code Style Guide) into IDEA and utilize the "Update Copyright" feature to keep the license header up-to-date.
Utilize IDEA plugins such as Reformat and Clean Code for code formatting.
fix(server): unify the license headers (#2438)
fix(server): unify the license headers (#2438)
fix issue apache#2435 subTask refine the hg-style.xml specification
returnToInnocence commentedon Feb 23, 2024
Adhere to the code conventions outlined in HugeGraph-Code-Style-Guide (please refine the hg-style.xml specification @returnToInnocence)#2457
returnToInnocence commentedon Feb 27, 2024
Suddenly a new idea, perhaps as a future thing to do, is to try to migrate the entire contents of the entire
hg-style.xmlfile to.editorconfigThis is because the.editorconfig file has some other advantages that
hg-style.xmldoes not have when I was looking at the documentation for this, such as:.editorconfigfile can also define coding conventions that cannot be defined byhg-style.xml, such as code style, formatting, and naming, which can help improve code consistency and readability..editorconfigfile 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 overwrittenTherefore, I wonder if we should further try to gather the configuration of a function as much as possible in the future, instead of spreading it into multiple Settings, and reduce the user's perception of format as little as possible at one time
VGalaxies commentedon Feb 27, 2024
Indeed, I found that #2457 uses both
hugegraph-style.xmland.editorconfigto control code style. If the control scope of the editorconfig file is broader than the idea code style XML, it might be worth considering consolidating them into.editorconfig.Perhaps it's possible to export the current
hugegraph-style.xmlto.editorconfigformat and merge it with the existing.editorconfigto see if the previously defined styles are compromised...returnToInnocence commentedon Feb 27, 2024
get it! I will try to export it this afternoon to see how it works!

returnToInnocence commentedon Feb 28, 2024
Since the above two tasks are logically coherent, I merged them into one @msgui
https://hugegraph.feishu.cn/wiki/NzaxwWIRHi5mJGkXkR0cHx6mnbg