diff --git a/.clang-tidy b/.clang-tidy index 925a8bd..120f743 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -41,3 +41,5 @@ CheckOptions: value: CamelCase - key: readability-identifier-naming.MethodCase value: camelBack + - key: readability-identifier-naming.ParameterCase + value: lower_case diff --git a/AGENTS.md b/AGENTS.md index 0494bd8..b48b00f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -99,6 +99,8 @@ repository has an `AGENTS.md` with conflicting rules they should take priority. - Add the LiveKit copyright header with the correct year to new code files. - Prefer the constructor initializer list rather than variable declaration and assignment in the constructor body. +- Use `CamelCase` for types/classes, `camelBack` for methods, and + `snake_case` for parameters (enforced by `readability-identifier-naming`). - For Doxygen/doc comments, prefer `///` comment style and use @brief, @param, @return, @throw, @ref, @note, @warning as applicable. diff --git a/docs/clang-tidy.md b/docs/clang-tidy.md index 2643faa..ed0ada4 100644 --- a/docs/clang-tidy.md +++ b/docs/clang-tidy.md @@ -24,7 +24,7 @@ for all available checks. | `modernize-*` | Encourages modern C++17 idioms: `auto`, range-for, `override`, `nullptr`, smart pointers. | | `readability-misleading-indentation` | Catches indentation that suggests a different control flow than what actually executes. | | `readability-redundant-smartptr-get` | Flags `ptr.get()` calls where `*ptr` or `ptr->` would suffice – reduces noise and makes smart pointer usage idiomatic. | -| `readability-identifier-naming` | Enforces consistent class and method naming conventions across LiveKit C++ projects. | +| `readability-identifier-naming` | Enforces consistent class, method, and parameter naming conventions across LiveKit C++ projects. | | `misc-const-correctness` | Similar to Rust, ensures variables are immutable by default unless intended to be changed. | ## Excluded Checks @@ -73,6 +73,7 @@ shared LiveKit C++ style. | `FormatStyle: file` | Uses the project’s `.clang-format` for any auto-fix formatting, keeping fixes consistent with the existing code style. | | `readability-identifier-naming.ClassCase: CamelCase` | Requires class names to use `CamelCase`. | | `readability-identifier-naming.MethodCase: camelBack` | Requires method names to use `camelBack`. | +| `readability-identifier-naming.ParameterCase: lower_case` | Requires function and method parameters to use `snake_case` (e.g. `well_known`, `track_name`). Without this option, `readability-identifier-naming` ignores parameter names even though the check itself is enabled. | ## Other Settings