|
|
# Formatting
|
|
|
|
|
|
The easiest way to get the correct formatting is setting up `clang-format-12`. With the provided `.clang-format` file the files then can be formatted correctly.
|
|
|
|
|
|
# Naming conventions
|
|
|
|
|
|
The following naming conventions should be followed when contributing. These conventions can be checked with the `clang-tidy` using the provided `.clang-tidy` file. Please be aware that our exception for Qt slots unfortunately does not allow automatic testing. But most IDEs support `clang-tidy` which should lead to (visual) warnings.
|
|
|
|
|
|
- filenames: `classname.h`/`classname.cpp`
|
|
|
- class names: `CamelCase`
|
|
|
- function names: `camelBack`
|
|
|
- parameter names: `camelBack`
|
|
|
- macro defintions: `UPPER_CASE`
|
|
|
- member variable prefix: `m`
|
|
|
- member variable names: `CamelCase` -> results in `mCamelCase`
|
|
|
- struct names: `CamelCase`
|
|
|
- variable names: `camelBack`
|
|
|
- global constants names: `UPPER_CASE`
|
|
|
- namespace names: `camelBack`
|
|
|
|
|
|
Exceptions:
|
|
|
- slot names: `on_snake_case`
|
|
|
|
|
|
|
|
|
# Refactoring Guidelines
|
|
|
|
|
|
In the course of finished any task, you will most likely touch some legacy code. If you do more than renaming something, please also make sure to fix following issues:
|
|
|
- comments:
|
|
|
- missing doxygen description of function
|
|
|
- translate comments to English
|
|
|
- remove any commented out code, which is not needed anymore (thanks to git it is never lost completely)
|
|
|
- code style:
|
|
|
- use range-based loops if possible
|
|
|
- move variable declaration to the first usage and not top of scope (in particular loop indices!)
|
|
|
- improve variable names
|
|
|
- check if function can be made `const` or `static`
|
|
|
|
|
|
<!---
|
|
|
Copied from todo.txt:
|
|
|
```
|
|
|
Programmierhinweise:
|
... | ... | @@ -13,4 +51,5 @@ Programmierhinweise: |
|
|
- helper.h beinhaltet Hilffunktion zB zum debuggen
|
|
|
- was bei weitergabe benoetigt wird steht unter seyfriedVers1
|
|
|
- von qt sind sources unter src komplett einsehbar
|
|
|
``` |
|
|
\ No newline at end of file |
|
|
```
|
|
|
--> |
|
|
\ No newline at end of file |