diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e214eb1d8..1026fb78c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -143,6 +143,8 @@ Try to stay inline with the code that surrounds you, having an entire package or * Packages must be all lowercase, consecutive words should generally be avoided. (e.g. `io.github.thebusybiscuit.slimefun4.core.something`) #### 7. Style preferences * Use **Spaces**, not Tabs! +* Try to keep ternary operators to a minimum, only in return statements (e.g. avoid doing this: `int y = x == null ? 1: 2`) +* if/else statements should always include a bracket, please avoid one-line statements (e.g. Avoid doing: `if (x == 0) return;`) * We do not enforce any particular width or column limit, but try to prevent your lines from becoming too long. * Annotations for methods or fields should never go on the same line, place them on the line above. * Comments should never go on the same line as code! Always above or below. @@ -150,7 +152,12 @@ Try to stay inline with the code that surrounds you, having an entire package or * Empty blocks like constructors should not occupy more than one line. (e.g. `private MyClass() {}`) * Modifiers for classes and fields must follow this order:
`(public/protected/private) (abstract) (static) (final)` -* if/else statements should always include a bracket, please avoid one-line statements (e.g. Avoid doing: `if (x == 0) return;`) +* We recommend using horizontal whitespaces like this: + * In variable assignments: `int x = 123;` + * In a for-loop: `for (int i = 0; i < 10; i++) {` + * Before and after statement parenthesis: `if (x != null) {` + * Inbetween array initializers: `int[] array = { 1, 2, 3 }; + * After the double slash of a comment: `// This is a comment` * Slimefun follows the **1TBS / OTBS** Bracket-Style standard (One true brace style): ```java private void example(int x) {