================
@@ -0,0 +1,90 @@
+.. title:: clang-tidy - llvm-header-guard
+
+misc-header-guard
+=================
+
+Finds and fixes header guards.
+
+Options
+-------
+
+.. option:: HeaderDirs
+
+   A semicolon-separated list of one or more header directory names. Header
+   directories may contain `/` as path separator. The list is searched for the
+   first matching string. The header guard will start from this path
+   component. Default value is `include`.
+
+.. option:: Prefix
+
+   A string specifying an optional prefix that is applied to each header guard.
+   Default is an empty string.
+
+.. option:: EndifComment
+
+   A boolean that controls whether the endif namespace comment is suggested.
+   Default value is `false`.
+
+.. option:: AllowPragmaOnce
+
+   A boolean that controls whether ``#pragma once`` directive is allowed.
+   Default value is `false`.
+
+Examples
+--------
+
+Header file: ``/path/to/include/component/header.hpp``:
+
+By default, the check ensures following header guard:
+
+.. code-block:: c++
+
+  #ifndef COMPONENT_HEADER_HPP
+  #define COMPONENT_HEADER_HPP
+  ...
+  # endif
+
+E.g. :option:`HeaderDirs` is set to following values:
----------------
vbvictor wrote:

Instead of giving separate examples for each option, lets add corresponding 
example to each option, like in 
[const-correctness](https://clang.llvm.org/extra/clang-tidy/checks/misc/const-correctness.html#cmdoption-arg-WarnPointersAsPointers)
 for example.

We usually (if not always) keep examples inside option description if the 
example shows how the option works.

https://github.com/llvm/llvm-project/pull/177315
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to