diff --git a/clang-tools-extra/docs/clang-tidy/GlobalOptions.rst b/clang-tools-extra/docs/clang-tidy/GlobalOptions.rst new file mode 100644 index 0000000000000..c717784eb2dff --- /dev/null +++ b/clang-tools-extra/docs/clang-tidy/GlobalOptions.rst @@ -0,0 +1,21 @@ +============== +Global Options +============== + +Some options apply to multiple checks. This page lists all the available +globally options. + +.. option:: IncludeStyle + + A string specifying which include-style is used, `llvm` or `google`. Default + is `llvm`. + +.. option:: IgnoreMacros + + If set to `true`, the check will not give warnings inside macros. Default + is `true`. + +.. option:: StrictMode + + When `true`, some checkers will be more stringent. The default value depends + on the checks. diff --git a/clang-tools-extra/docs/clang-tidy/checks/abseil/string-find-startswith.rst b/clang-tools-extra/docs/clang-tidy/checks/abseil/string-find-startswith.rst index 41a7ab500d7ce..acbca2c9441e8 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/abseil/string-find-startswith.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/abseil/string-find-startswith.rst @@ -39,8 +39,7 @@ Options .. option:: IncludeStyle - A string specifying which include-style is used, `llvm` or `google`. Default - is `llvm`. + See :doc:`global options <../../GlobalOptions>`. .. option:: AbseilStringsMatchHeader diff --git a/clang-tools-extra/docs/clang-tidy/checks/abseil/string-find-str-contains.rst b/clang-tools-extra/docs/clang-tidy/checks/abseil/string-find-str-contains.rst index 042fbdb3f29a9..36eb67ad0f92c 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/abseil/string-find-str-contains.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/abseil/string-find-str-contains.rst @@ -43,8 +43,7 @@ Options .. option:: IncludeStyle - A string specifying which include-style is used, `llvm` or `google`. Default - is `llvm`. + See :doc:`global options <../../GlobalOptions>`. .. option:: AbseilStringsMatchHeader diff --git a/clang-tools-extra/docs/clang-tidy/checks/boost/use-ranges.rst b/clang-tools-extra/docs/clang-tidy/checks/boost/use-ranges.rst index 4c032ad32f4fd..7d34f197f2f24 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/boost/use-ranges.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/boost/use-ranges.rst @@ -162,8 +162,7 @@ Options .. option:: IncludeStyle - A string specifying which include-style is used, `llvm` or `google`. Default - is `llvm`. + See :doc:`global options <../../GlobalOptions>`. .. option:: IncludeBoostSystem diff --git a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/avoid-do-while.rst b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/avoid-do-while.rst index 4b195c92e1f76..b648ee147612f 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/avoid-do-while.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/avoid-do-while.rst @@ -26,7 +26,8 @@ Options .. option:: IgnoreMacros - Ignore the check when analyzing macros. This is useful for safely defining function-like macros: + See :doc:`global options <../../GlobalOptions>`. + This is useful for safely defining function-like macros: .. code-block:: c++ diff --git a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/init-variables.rst b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/init-variables.rst index 0465436234b13..98bf822dbd738 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/init-variables.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/init-variables.rst @@ -62,8 +62,7 @@ Options .. option:: IncludeStyle - A string specifying which include-style is used, `llvm` or `google`. Default - is `llvm`. + See :doc:`global options <../../GlobalOptions>`. .. option:: MathHeader diff --git a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/pro-bounds-constant-array-index.rst b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/pro-bounds-constant-array-index.rst index 4e877676cf1fe..0834a9c895b39 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/pro-bounds-constant-array-index.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/pro-bounds-constant-array-index.rst @@ -24,5 +24,4 @@ Options .. option:: IncludeStyle - A string specifying which include-style is used, `llvm` or `google`. Default - is `llvm`. + See :doc:`global options <../../GlobalOptions>`. diff --git a/clang-tools-extra/docs/clang-tidy/checks/misc/uniqueptr-reset-release.rst b/clang-tools-extra/docs/clang-tidy/checks/misc/uniqueptr-reset-release.rst index 8d48fa192e69f..24e74b4ef8815 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/misc/uniqueptr-reset-release.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/misc/uniqueptr-reset-release.rst @@ -20,5 +20,4 @@ Options .. option:: IncludeStyle - A string specifying which include-style is used, `llvm` or `google`. Default - is `llvm`. + See :doc:`global options <../../GlobalOptions>`. diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize/loop-convert.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize/loop-convert.rst index 9aa655feb5338..13270195a656a 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/modernize/loop-convert.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize/loop-convert.rst @@ -169,8 +169,7 @@ lives. .. option:: IncludeStyle - A string specifying which include-style is used, `llvm` or `google`. Default - is `llvm`. + See :doc:`global options <../../GlobalOptions>`. Limitations ----------- diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize/make-shared.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize/make-shared.rst index 9c1fceaa06000..4c54b26dd616c 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/modernize/make-shared.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize/make-shared.rst @@ -41,13 +41,11 @@ Options .. option:: IncludeStyle - A string specifying which include-style is used, `llvm` or `google`. Default - is `llvm`. + See :doc:`global options <../../GlobalOptions>`. .. option:: IgnoreMacros - If set to `true`, the check will not give warnings inside macros. Default - is `true`. + See :doc:`global options <../../GlobalOptions>`. .. option:: IgnoreDefaultInitialization diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize/make-unique.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize/make-unique.rst index cd474d352bac0..d21815b926303 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/modernize/make-unique.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize/make-unique.rst @@ -41,13 +41,11 @@ Options .. option:: IncludeStyle - A string specifying which include-style is used, `llvm` or `google`. Default - is `llvm`. + See :doc:`global options <../../GlobalOptions>`. .. option:: IgnoreMacros - If set to `true`, the check will not give warnings inside macros. Default - is `true`. + See :doc:`global options <../../GlobalOptions>`. .. option:: IgnoreDefaultInitialization diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize/min-max-use-initializer-list.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize/min-max-use-initializer-list.rst index d6721a25629b0..26160f0c16de4 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/modernize/min-max-use-initializer-list.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize/min-max-use-initializer-list.rst @@ -37,8 +37,7 @@ Options .. option:: IncludeStyle - A string specifying which include-style is used, `llvm` or `google`. Default - is `llvm`. + See :doc:`global options <../../GlobalOptions>`. .. option:: IgnoreNonTrivialTypes diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize/pass-by-value.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize/pass-by-value.rst index e884cf3c4f5df..f9a420acedf4e 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/modernize/pass-by-value.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize/pass-by-value.rst @@ -157,8 +157,7 @@ Options .. option:: IncludeStyle - A string specifying which include-style is used, `llvm` or `google`. Default - is `llvm`. + See :doc:`global options <../../GlobalOptions>`. .. option:: ValuesOnly diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize/replace-auto-ptr.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize/replace-auto-ptr.rst index 87321316e000d..4ab4791439a8b 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/modernize/replace-auto-ptr.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize/replace-auto-ptr.rst @@ -75,5 +75,4 @@ Options .. option:: IncludeStyle - A string specifying which include-style is used, `llvm` or `google`. Default - is `llvm`. + See :doc:`global options <../../GlobalOptions>`. diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize/type-traits.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize/type-traits.rst index c2abde856c90f..c0b2add10c329 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/modernize/type-traits.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize/type-traits.rst @@ -29,7 +29,7 @@ Options .. option:: IgnoreMacros - If `true` don't diagnose traits defined in macros. + See :doc:`global options <../../GlobalOptions>`. Note: Fixes will never be emitted for code inside of macros. diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize/use-bool-literals.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize/use-bool-literals.rst index 27cf79b6e3a8c..1d553d234fe93 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/modernize/use-bool-literals.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize/use-bool-literals.rst @@ -24,5 +24,4 @@ Options .. option:: IgnoreMacros - If set to `true`, the check will not give warnings inside macros. Default - is `true`. + See :doc:`global options <../../GlobalOptions>`. diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize/use-default-member-init.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize/use-default-member-init.rst index 2d3ed38014937..05163ee0076fe 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/modernize/use-default-member-init.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize/use-default-member-init.rst @@ -50,5 +50,4 @@ Options .. option:: IgnoreMacros - If this option is set to `true` (default is `true`), the check will not warn - about members declared inside macros. + See :doc:`global options <../../GlobalOptions>`. diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize/use-equals-default.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize/use-equals-default.rst index 7bd6fa93ba1ea..3ef2365ac93b5 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/modernize/use-equals-default.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize/use-equals-default.rst @@ -32,6 +32,7 @@ Options .. option:: IgnoreMacros + See :doc:`global options <../../GlobalOptions>`. If set to `true`, the check will not give warnings inside macros and will ignore special members with bodies contain macros or preprocessor directives. Default is `true`. diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize/use-equals-delete.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize/use-equals-delete.rst index d354fcc6060ce..cb367192219c5 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/modernize/use-equals-delete.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize/use-equals-delete.rst @@ -41,5 +41,4 @@ for manually relocating functions to the ``public`` section. .. option:: IgnoreMacros - If this option is set to `true` (default is `true`), the check will not warn - about functions declared inside macros. + See :doc:`global options <../../GlobalOptions>`. diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize/use-ranges.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize/use-ranges.rst index 1ce866ca1f66a..cc9851a106093 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/modernize/use-ranges.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize/use-ranges.rst @@ -127,8 +127,7 @@ Options .. option:: IncludeStyle - A string specifying which include-style is used, `llvm` or `google`. Default - is `llvm`. + See :doc:`global options <../../GlobalOptions>`. .. option:: UseReversePipe diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize/use-std-numbers.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize/use-std-numbers.rst index 207e9c00e74ba..f331cc33d6665 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/modernize/use-std-numbers.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize/use-std-numbers.rst @@ -70,5 +70,4 @@ Options .. option:: IncludeStyle - A string specifying which include-style is used, `llvm` or `google`. Default - is `llvm`. + See :doc:`global options <../../GlobalOptions>`. diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize/use-using.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize/use-using.rst index 32272a07994c2..65658ccaa6229 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/modernize/use-using.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize/use-using.rst @@ -43,8 +43,7 @@ Options .. option:: IgnoreMacros - If set to `true`, the check will not give warnings inside macros. Default - is `true`. + See :doc:`global options <../../GlobalOptions>`. .. option:: IgnoreExternC diff --git a/clang-tools-extra/docs/clang-tidy/checks/performance/unnecessary-value-param.rst b/clang-tools-extra/docs/clang-tidy/checks/performance/unnecessary-value-param.rst index cc5e1ae73508c..bc57bc32f2f9e 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/performance/unnecessary-value-param.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/performance/unnecessary-value-param.rst @@ -59,8 +59,7 @@ Options .. option:: IncludeStyle - A string specifying which include-style is used, `llvm` or `google`. Default - is `llvm`. + See :doc:`global options <../../GlobalOptions>`. .. option:: AllowedTypes diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability/avoid-const-params-in-decls.rst b/clang-tools-extra/docs/clang-tidy/checks/readability/avoid-const-params-in-decls.rst index b1146e9da79ba..7678e29f5d782 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/readability/avoid-const-params-in-decls.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/readability/avoid-const-params-in-decls.rst @@ -21,5 +21,4 @@ Options .. option:: IgnoreMacros - If set to `true`, the check will not give warnings inside macros. Default - is `true`. + See :doc:`global options <../../GlobalOptions>`. diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability/const-return-type.rst b/clang-tools-extra/docs/clang-tidy/checks/readability/const-return-type.rst index ec81d46750d44..29a6f490cb89b 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/readability/const-return-type.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/readability/const-return-type.rst @@ -31,5 +31,4 @@ Options .. option:: IgnoreMacros - If set to `true`, the check will not give warnings inside macros. Default - is `true`. + See :doc:`global options <../../GlobalOptions>`. diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability/function-cognitive-complexity.rst b/clang-tools-extra/docs/clang-tidy/checks/readability/function-cognitive-complexity.rst index ffd2b2c68c8d2..49ae48beb1499 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/readability/function-cognitive-complexity.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/readability/function-cognitive-complexity.rst @@ -26,8 +26,9 @@ Options .. option:: IgnoreMacros - If set to `true`, the check will ignore code inside macros. Note, that also - any macro arguments are ignored, even if they should count to the complexity. + See :doc:`global options <../../GlobalOptions>`. + Note, that also any macro arguments are ignored, even if they should count + to the complexity. As this might change in the future, this option isn't guaranteed to be forward-compatible. Default is `false`. diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability/inconsistent-declaration-parameter-name.rst b/clang-tools-extra/docs/clang-tidy/checks/readability/inconsistent-declaration-parameter-name.rst index 95341d52da4f6..dc2b77403ea93 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/readability/inconsistent-declaration-parameter-name.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/readability/inconsistent-declaration-parameter-name.rst @@ -54,8 +54,7 @@ the definition or the first declaration seen in a translation unit. .. option:: IgnoreMacros - If this option is set to `true` (default is `true`), the check will not warn - about names declared inside macros. + See :doc:`global options <../../GlobalOptions>`. .. option:: Strict diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability/redundant-casting.rst b/clang-tools-extra/docs/clang-tidy/checks/readability/redundant-casting.rst index 23eaa225f03a3..27b4d1bf42ea8 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/readability/redundant-casting.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/readability/redundant-casting.rst @@ -27,8 +27,7 @@ Options .. option:: IgnoreMacros - If set to `true`, the check will not give warnings inside macros. Default - is `true`. + See :doc:`global options <../../GlobalOptions>`. .. option:: IgnoreTypeAliases diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability/redundant-declaration.rst b/clang-tools-extra/docs/clang-tidy/checks/readability/redundant-declaration.rst index 2a7ecac73c4c1..d0314175cde8c 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/readability/redundant-declaration.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/readability/redundant-declaration.rst @@ -33,5 +33,4 @@ Options .. option:: IgnoreMacros - If set to `true`, the check will not give warnings inside macros. Default - is `true`. + See :doc:`global options <../../GlobalOptions>`. diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability/redundant-smartptr-get.rst b/clang-tools-extra/docs/clang-tidy/checks/readability/redundant-smartptr-get.rst index 20851b0acad97..9c608ff00573f 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/readability/redundant-smartptr-get.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/readability/redundant-smartptr-get.rst @@ -17,5 +17,5 @@ Examples: .. option:: IgnoreMacros - If this option is set to `true` (default is `true`), the check will not warn - about calls inside macros. + See :doc:`global options <../../GlobalOptions>`. + diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability/simplify-boolean-expr.rst b/clang-tools-extra/docs/clang-tidy/checks/readability/simplify-boolean-expr.rst index 3d00d5b043a60..0ddc156db2525 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/readability/simplify-boolean-expr.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/readability/simplify-boolean-expr.rst @@ -84,8 +84,7 @@ Options .. option:: IgnoreMacros - If `true`, ignore boolean expressions originating from expanded macros. - Default is `false`. + See :doc:`global options <../../GlobalOptions>`. .. option:: ChainedConditionalReturn diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability/uppercase-literal-suffix.rst b/clang-tools-extra/docs/clang-tidy/checks/readability/uppercase-literal-suffix.rst index f2809dbc0b5f9..a4ef1dadc430f 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/readability/uppercase-literal-suffix.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/readability/uppercase-literal-suffix.rst @@ -52,5 +52,4 @@ Given a list `L;uL`: .. option:: IgnoreMacros - If this option is set to `true` (default is `true`), the check will not warn - about literal suffixes inside macros. + See :doc:`global options <../../GlobalOptions>`. diff --git a/clang-tools-extra/docs/clang-tidy/index.rst b/clang-tools-extra/docs/clang-tidy/index.rst index a4233d5d8e269..a3048bf2c1a8f 100644 --- a/clang-tools-extra/docs/clang-tidy/index.rst +++ b/clang-tools-extra/docs/clang-tidy/index.rst @@ -10,6 +10,7 @@ See also: :maxdepth: 1 The list of clang-tidy checks + The list of clang-tidy global options Clang-tidy IDE/Editor Integrations Getting Involved External Clang-Tidy Examples