-
Notifications
You must be signed in to change notification settings - Fork 8.9k
optimize: Apply Spotless to the entire codebase #7450
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
optimize: Apply Spotless to the entire codebase #7450
Conversation
Signed-off-by: yongjunhong <[email protected]>
Signed-off-by: yongjunhong <[email protected]>
Signed-off-by: yongjunhong <[email protected]>
|
PTAL! |
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.
Pull Request Overview
This PR applies Spotless formatting to the entire codebase, ensuring consistency in code style and cleaning up extraneous whitespace.
- Reformatting of Java classes in the exception package and common utility classes
- Updates to GitHub workflow files to enforce and check code formatting violations
- Minor adjustments such as inlining empty constructor bodies and multi-line string concatenation
Reviewed Changes
Copilot reviewed 19 out of 1956 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| common/src/main/java/org/apache/seata/common/exception/SeataRuntimeException.java | Added a blank line for formatting consistency |
| common/src/main/java/org/apache/seata/common/exception/RetryableException.java | Removed redundant blank lines |
| common/src/main/java/org/apache/seata/common/exception/ResourceBundleUtil.java | Refactored string builder formatting and adjusted exception throws across multiple lines |
| common/src/main/java/org/apache/seata/common/exception/ParseEndpointException.java | Reformatted constructor definitions |
| common/src/main/java/org/apache/seata/common/exception/JsonParseException.java | Removed extraneous blank line |
| common/src/main/java/org/apache/seata/common/exception/FrameworkException.java | Reformatted import and spacing |
| common/src/main/java/org/apache/seata/common/exception/FrameworkErrorCode.java | Reformatted enum constant definitions |
| common/src/main/java/org/apache/seata/common/exception/ExceptionUtil.java | Reformatted private constructor definition |
| common/src/main/java/org/apache/seata/common/exception/ErrorCode.java | Removed extra whitespace |
| common/src/main/java/org/apache/seata/common/exception/DataAccessException.java | Removed superfluous blank lines |
| common/src/main/java/org/apache/seata/common/exception/AuthenticationFailedException.java | Adjusted spacing by removing an unnecessary blank line |
| common/src/main/java/org/apache/seata/common/exception/AbstractRemoteResourceBundle.java | Rewrote empty class body in a single line for brevity |
| common/src/main/java/org/apache/seata/common/XID.java | Updated multi-line StringBuilder usage for readability |
| common/src/main/java/org/apache/seata/common/NamingServerConstants.java | Trimmed trailing blank line |
| common/src/main/java/org/apache/seata/common/Constants.java | Removed superfluous whitespace |
| common/src/main/java/org/apache/seata/common/ConfigurationKeys.java | Reformatted constant definitions to span multiple lines for clarity |
| .github/workflows/spotless-check.yml | Added a new workflow to enforce Spotless formatting checks |
| .github/workflows/rerun-build.yml | Enhanced workflow logic to conditionally rerun builds based on spotless failure detection |
| .github/workflows/build.yml | Adjusted job names and removed the checkstyle flag for Java 8 builds |
|
Should we keep the CheckStyle dependency, or remove it? |
|
If Spotless Check is already being used as a replacement, then I believe CheckStyle is no longer necessary @xingfudeshi PTAL |
Signed-off-by: yongjunhong <[email protected]>
Signed-off-by: yongjunhong <[email protected]>
Done in 732fd15 ! |
funky-eyes
left a comment
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
xingfudeshi
left a comment
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
|
Please register your PR in those two files : |
Signed-off-by: yongjunhong <[email protected]>
Done in cec50d4 ! |
|
Spotless Check / spotless (pull_request) |
Signed-off-by: yongjunhong <[email protected]>
PTAL! |
* Add spotless-check.yml Signed-off-by: yongjunhong <[email protected]> * when spotless check fails do not retry Signed-off-by: yongjunhong <[email protected]> * apply spotless to entire codebase Signed-off-by: yongjunhong <[email protected]> * Remove checkstyle dependency Signed-off-by: yongjunhong <[email protected]> * Remove checkstyle dependency Signed-off-by: yongjunhong <[email protected]> * Add changes Signed-off-by: yongjunhong <[email protected]> * Apply spotless Signed-off-by: yongjunhong <[email protected]> --------- Signed-off-by: yongjunhong <[email protected]> Co-authored-by: funkye <[email protected]>
* Add spotless-check.yml Signed-off-by: yongjunhong <[email protected]> * when spotless check fails do not retry Signed-off-by: yongjunhong <[email protected]> * apply spotless to entire codebase Signed-off-by: yongjunhong <[email protected]> * Remove checkstyle dependency Signed-off-by: yongjunhong <[email protected]> * Remove checkstyle dependency Signed-off-by: yongjunhong <[email protected]> * Add changes Signed-off-by: yongjunhong <[email protected]> * Apply spotless Signed-off-by: yongjunhong <[email protected]> --------- Signed-off-by: yongjunhong <[email protected]> Co-authored-by: funkye <[email protected]>
Workflow Updates:
.github/workflows/spotless-check.ymlto ensure code formatting compliance using Spotless. This workflow runs on specific branches and pull request events..github/workflows/rerun-build.ymlto include a step for detecting Spotless-related failures and skipping retries if the failure is due to Spotless violations.Workflow Modifications:
.github/workflows/build.ymlto exclude Checkstyle checks from the Maven test step for Java 8, simplifying the build process.