What changed, and why it matters
This commit only reorganizes developer documentation about code style and the clang-tidy checking tool. It removes an outdated note, moves a recursion-related note into a new subsection, and adds a link to upstream clang-tidy documentation. No program code was changed, so there is no security impact.
No security action needed. This is a documentation-only change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies doc/developer-notes.md only. It deletes the explicit ‘nullptr is preferred over NULL’ rule (because the modernize-use-nullptr check has been enabled for years), moves the NOLINTNEXTLINE(misc-no-recursion) guidance under a new ‘clang-tidy rules’ section, and adds a pointer to upstream clang-tidy documentation. No source, build, or configuration code is altered.
Changed components
doc/developer-notes.mdInspect captured patch +13 / −5
diff --git a/doc/developer-notes.md b/doc/developer-notes.md
index eac70382..1fa2d7fe 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:
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.