mirror of
https://github.com/Kareadita/Kavita.git
synced 2026-03-11 04:26:11 -04:00
Co-authored-by: Amelia <77553571+Fesaa@users.noreply.github.com> Co-authored-by: DieselTech <30128380+DieselTech@users.noreply.github.com> Co-authored-by: Alex George <xzeroknightx@gmail.com> Co-authored-by: Lucas Winther <lucasw89@live.dk> Co-authored-by: Toni Kielo <toni.kielo@gmail.com> Co-authored-by: Patrick Orave <oravep@gmail.com>
19 lines
698 B
Markdown
19 lines
698 B
Markdown
## Coding Guidelines
|
|
- Anytime you don't use {} on an if statement, it must be on one line and MUST be a jump operation (return/continue/break). All other times, you must use {} and be on 2 lines.
|
|
- Use var whenever possible
|
|
- return statements should generally have a newline above them
|
|
Examples:
|
|
```csharp
|
|
# Case when okay - simple logic flow
|
|
var a = 2 + 3;
|
|
return a;
|
|
|
|
# Case when needs newline - complex logic is grouped together
|
|
var a = b + c;
|
|
_imageService.Resize(...);
|
|
|
|
return;
|
|
```
|
|
- Operation (+,-,*, etc) should always have spaces around it; I.e. `a + b` not `a+b`.
|
|
- When setting href directectly (not using Angulars routing) it should always be prefixed with baseURL
|