mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-19 19:25:48 +00:00
Horizontal whitespaces
This commit is contained in:
parent
95084eff70
commit
4936c25e49
@ -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`)
|
* Packages must be all lowercase, consecutive words should generally be avoided. (e.g. `io.github.thebusybiscuit.slimefun4.core.something`)
|
||||||
#### 7. Style preferences
|
#### 7. Style preferences
|
||||||
* Use **Spaces**, not Tabs!
|
* 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.
|
* 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.
|
* 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.
|
* 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() {}`)
|
* Empty blocks like constructors should not occupy more than one line. (e.g. `private MyClass() {}`)
|
||||||
* Modifiers for classes and fields must follow this order:<br>
|
* Modifiers for classes and fields must follow this order:<br>
|
||||||
`(public/protected/private) (abstract) (static) (final)`
|
`(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):
|
* Slimefun follows the **1TBS / OTBS** Bracket-Style standard (One true brace style):
|
||||||
```java
|
```java
|
||||||
private void example(int x) {
|
private void example(int x) {
|
||||||
|
Loading…
Reference in New Issue
Block a user