diff --git a/doc/developer-notes.md b/doc/developer-notes.md index eac70382883..1fa2d7fe743 100644 --- a/doc/developer-notes.md +++ b/doc/developer-notes.md @@ -55,7 +55,6 @@ code. - **Miscellaneous** - `++i` is preferred over `i++`. - - `nullptr` is preferred over `NULL` or `(void*)0`. - `static_assert` is preferred over `assert` where possible. Generally; compile-time checking is preferred over run-time checking. - Use a named cast or functional cast, not a C-Style cast. When casting between integer types, use functional casts such as `int(x)` or `int{x}` @@ -63,8 +62,6 @@ code. Use `reinterpret_cast` and `const_cast` as appropriate. - Prefer [`list initialization ({})`](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#res-list) where possible. For example `int x{0};` instead of `int x = 0;` or `int x(0);` - - Recursion is checked by clang-tidy and thus must be made explicit. Use - `NOLINTNEXTLINE(misc-no-recursion)` to suppress the check. For function calls a namespace should be specified explicitly, unless such functions have been declared within it. Otherwise, [argument-dependent lookup](https://en.cppreference.com/w/cpp/language/adl), also known as ADL, could be @@ -140,7 +137,18 @@ public: non-optional in-out and output parameters should usually be references, as they cannot be null. -### Coding Style (C++ named arguments) +### Coding Style (clang-tidy rules) + +The clang-tidy tool is used to check some rules. Please refer to the [upstream +documentation](https://clang.llvm.org/extra/clang-tidy/checks/list.html) about +the details and rationale for each rule. + +#### C++ Recursive Functions + +Recursion is checked by clang-tidy and thus must be made explicit. Use +`NOLINTNEXTLINE(misc-no-recursion)` to suppress the check. + +#### C++ named arguments When passing named arguments, use a format that clang-tidy understands. The argument names can otherwise not be verified by clang-tidy. @@ -156,7 +164,7 @@ int main() } ``` -### Running clang-tidy +#### Running clang-tidy To run clang-tidy on Ubuntu/Debian, install the dependencies: