Improve todo and formatting

This commit is contained in:
Dennis Eichhorn 2021-11-26 15:40:19 +01:00 committed by GitHub
parent bde2e37a0b
commit dfbc71ece0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -49,11 +49,15 @@ Never use spaces between variables and atomic operations (e.g. `!`, `++`, `--`)
Don't use whitespace inside ANY parentheses (e.g. functions, loops, conditions, catch, closures). Don't use whitespace inside ANY parentheses (e.g. functions, loops, conditions, catch, closures).
```js ```js
for (let i = 1; i < 100; ++i) { ... } for (let i = 1; i < 100; ++i) {
...
}
``` ```
```js ```js
function(para1, para2) { ... } function(para1, para2) {
...
}
``` ```
### Brackets ### Brackets
@ -70,13 +74,13 @@ Always use a whitespace between braces and keywords (e.g. else, while, catch, fi
```php ```php
try { try {
...
} catch (...); } catch (...);
``` ```
```php ```php
if (...) { if (...) {
...
} else (...); } else (...);
``` ```
@ -85,13 +89,14 @@ Braces are on the same line as the previous or following keyword except in class
```php ```php
function() function()
{ {
...
} }
``` ```
```php ```php
class Test class Test
{ {
...
} }
``` ```
@ -111,7 +116,7 @@ Always use braces even for potential one liners. The only exception is the terna
```php ```php
if (...) { if (...) {
...
} }
``` ```
@ -135,7 +140,7 @@ if (isTrue == true
|| isFalse === false || isFalse === false
&& isNotTrue !== true && isNotTrue !== true
) { ) {
...
} }
``` ```
@ -193,12 +198,18 @@ All string representations should use single quotes `''` unless `""` provides si
## Todos ## Todos
Most issues should be documented in the code as todo and vice versa. Todos should be documented in the [PROJECT.md](https://github.com/Orange-Management/Docs/blob/master/Project/PROJECT.md).
In code todos can be created like this
```php
// @todo: Single line todo
```
```php ```php
/** /**
* @todo Orange-Management/Repository#IssueNumber * @todo:
* Below comes the issue/todo description. * Multi line todo
* This way developers can see todos directly in the code without going to an external source. * This way developers can see todos directly in the code without going to an external source.
* Todos must not have empty lines in their descriptions. * Todos must not have empty lines in their descriptions.
* If the external ressources have empty lines they must be removed in the todo comment. * If the external ressources have empty lines they must be removed in the todo comment.
@ -207,4 +218,3 @@ Most issues should be documented in the code as todo and vice versa.
*/ */
``` ```
The issue information can be used to provide additional information such as priority, difficulty and type.