xref: /llvm-project/clang-tools-extra/docs/clang-tidy/checks/llvm/namespace-comment.rst (revision 6e566bc5523f743bc34a7e26f050f1f2b4d699a8)
1.. title:: clang-tidy - llvm-namespace-comment
2
3llvm-namespace-comment
4======================
5
6`google-readability-namespace-comments` redirects here as an alias for this
7check.
8
9Checks that long namespaces have a closing comment.
10
11https://llvm.org/docs/CodingStandards.html#namespace-indentation
12
13https://google.github.io/styleguide/cppguide.html#Namespaces
14
15.. code-block:: c++
16
17  namespace n1 {
18  void f();
19  }
20
21  // becomes
22
23  namespace n1 {
24  void f();
25  }  // namespace n1
26
27
28Options
29-------
30
31.. option:: ShortNamespaceLines
32
33   Requires the closing brace of the namespace definition to be followed by a
34   closing comment if the body of the namespace has more than
35   `ShortNamespaceLines` lines of code. The value is an unsigned integer that
36   defaults to `1U`.
37
38.. option:: SpacesBeforeComments
39
40   An unsigned integer specifying the number of spaces before the comment
41   closing a namespace definition. Default is `1U`.
42