Replies: 1 comment 8 replies
-
Draft standards look decent, though I still have some questions
public void someFn()
{
// code here
} I myself prefer: public void someFn() {
// code here
} as it makes the whole structure look more unified, and less like two separate structures (declaration and code body) glued together. This, combined with shorter line length, should be able to keep how many lines a group of codes will require roughly the same as the original Forge style.
The most common style I saw in current source code: if (someCondition) someCode; and a less common style: if (someCondition)
someCode; I myself prefer: if (someCondition) {
someCode;
} as it's more consistent with other code block handling. |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Introduces standardized code styling and formatting rules for CleanroomMC projects. It aims to ensure consistency across all code contributions by leveraging automated tools like Spotless, Checkstyle, and
.editorconfig
. These standards will apply to Java source files, Gradle scripts, JSON files, and other relevant formats.Goals
Non Goals
Motivation
Inconsistencies in formatting make code harder to read, maintain, and review. As we grow and accept more contributions, shared standard helps enforce clean and readable code. Automating these rules eliminates style debates during code review. We can get those debates out of the way right now...
Description
Java
JSON and Other Text Formats
.editorconfig
included to align formatting in all editorsTooling & Workflow
Add Spotless to
build.gradle
Add
.editorconfig
to the root of the projectInclude a GitHub Actions CI check for formatting and style validation
Add an appropriate
CONTRIBUTING.md
A basis of a spotless block as follows:
Dependencies
.editorconfig
References
Guidelines
Beta Was this translation helpful? Give feedback.
All reactions