[clang-tools-extra] [clang-tidy][doc][NFC] extract common global options in doc (PR #119842)

2024-12-13 Thread Congcong Cai via cfe-commits


@@ -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 

HerrCai0907 wrote:

I think the root cause is the style of titles. Some titles uppercase each word 
some not.
It looks like in clang/docs, most of rst files' titles use uppercase each word.

https://github.com/llvm/llvm-project/pull/119842
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [clang-tidy][doc][NFC] extract common global options in doc (PR #119842)

2024-12-13 Thread Congcong Cai via cfe-commits

HerrCai0907 wrote:

This PR is not in the correct way. see 
https://discourse.llvm.org/t/rfc-global-option-rules-for-clang-tidy/83647

https://github.com/llvm/llvm-project/pull/119842
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [clang-tidy][doc][NFC] extract common global options in doc (PR #119842)

2024-12-13 Thread Congcong Cai via cfe-commits

https://github.com/HerrCai0907 closed 
https://github.com/llvm/llvm-project/pull/119842
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [clang-tidy][doc][NFC] extract common global options in doc (PR #119842)

2024-12-13 Thread Nicolas van Kempen via cfe-commits


@@ -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 

nicovank wrote:

Just a drive-by comment, noticed this list sometimes uses clang-tidy, sometimes 
Clang-Tidy.

https://github.com/llvm/llvm-project/pull/119842
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [clang-tidy][doc][NFC] extract common global options in doc (PR #119842)

2024-12-13 Thread Congcong Cai via cfe-commits

HerrCai0907 wrote:

then I think the only option worth to promote is include style.

https://github.com/llvm/llvm-project/pull/119842
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [clang-tidy][doc][NFC] extract common global options in doc (PR #119842)

2024-12-13 Thread Carlos Galvez via cfe-commits

carlosgalvezp wrote:

It could also be that `getLocalOrGlobal` was added to keep backwards 
compatibility and never break users, e.g for an option that used to be local 
but has become global. But that doesn't mean that that's what we actually want 
users to do.

https://github.com/llvm/llvm-project/pull/119842
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [clang-tidy][doc][NFC] extract common global options in doc (PR #119842)

2024-12-13 Thread Carlos Galvez via cfe-commits

carlosgalvezp wrote:

They use getLocalOrGlobal probably by mistake, copy-pasting existing code. We 
should document what we believe makes sense, and fix the implementation 
accordingly. The current documentation says these options are check-specific, 
so users should be using them per-check instead of globally. Thus, we wouldn't 
break users if we change the implementation. So I would vote for replacing the 
getLocalOrGlobal with getLocal instead.

If we believe the current implementation is faulty, and document that 
implementation, then we'll have a much harder time to refactor the 
implementation to what we want (since by documenting, we "promise" a behavior). 

I remember now that the true global options are documented here:

https://github.com/llvm/llvm-project/blob/main/clang-tools-extra/docs/clang-tidy/index.rst?plain=1#L288

So if we create more global options (like `IncludeStyle`) we should probably 
put them there.



https://github.com/llvm/llvm-project/pull/119842
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [clang-tidy][doc][NFC] extract common global options in doc (PR #119842)

2024-12-13 Thread Congcong Cai via cfe-commits

HerrCai0907 wrote:

but in code level, we already use the getLocalOrGlobal. but unfortunately, i 
don't find any description about it. we should have the relative clean map 
between what we did in code and what we write in doc.
Those three options is not from my personal preferences. they are from current 
status of code.

https://github.com/llvm/llvm-project/pull/119842
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [clang-tidy][doc][NFC] extract common global options in doc (PR #119842)

2024-12-13 Thread Congcong Cai via cfe-commits

https://github.com/HerrCai0907 edited 
https://github.com/llvm/llvm-project/pull/119842
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [clang-tidy][doc][NFC] extract common global options in doc (PR #119842)

2024-12-13 Thread Congcong Cai via cfe-commits


@@ -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

HerrCai0907 wrote:

according to current implement of clangtidy, lots of checks will read ignores 
macros from global scope. i don't think it is a good idea to change lots of 
checks behavior.

maybe i can notices something in this file to explain global option doesn't 
apply from every check?

https://github.com/llvm/llvm-project/pull/119842
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [clang-tidy][doc][NFC] extract common global options in doc (PR #119842)

2024-12-13 Thread Carlos Galvez via cfe-commits

carlosgalvezp wrote:

I think the confusion comes from calling these "Global Options". They are not 
global, they "exist in multiple checks", however they can (and probably should) 
change independently of each other. My understanding is that the scope of this 
NFC patch is to DRY the documentation and put it in a common place like we do 
with regular code.

Like I wrote in the code comments, I don't believe we should DRY the 
documentation, as it makes it less usable. The clearest issue to tackle IMO 
would be  https://github.com/llvm/llvm-project/issues/113577 

https://github.com/llvm/llvm-project/pull/119842
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [clang-tidy][doc][NFC] extract common global options in doc (PR #119842)

2024-12-13 Thread via cfe-commits

EugeneZelenko wrote:

But #113577 is still open. Also local `IncludeStyle` should be just deprecated 
after.

https://github.com/llvm/llvm-project/pull/119842
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [clang-tidy][doc][NFC] extract common global options in doc (PR #119842)

2024-12-13 Thread Carlos Galvez via cfe-commits


@@ -26,7 +26,8 @@ Options
 
 .. option:: IgnoreMacros
 

carlosgalvezp wrote:

Personally I don't see much benefit in this change, it makes the documentation 
harder to read as one has to go back and forth. I don't see the trouble with 
this duplication, since it's not really a problem if the sentences don't match 
exactly with each other - it does not add maintenance cost.

Sometimes DRY can cause more trouble that it's worth - a bit of duplication 
makes sense in benefit of usability and readability.

https://github.com/llvm/llvm-project/pull/119842
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [clang-tidy][doc][NFC] extract common global options in doc (PR #119842)

2024-12-13 Thread Carlos Galvez via cfe-commits


@@ -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

carlosgalvezp wrote:

This option does not have any meaning in this context. Therefore I believe it 
should be kept local.



https://github.com/llvm/llvm-project/pull/119842
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [clang-tidy][doc][NFC] extract common global options in doc (PR #119842)

2024-12-13 Thread Carlos Galvez via cfe-commits


@@ -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

carlosgalvezp wrote:

I think this one should  _not_ be global. The same is done for clang warnings. 
Sometimes it may make sense to ignore macros, sometimes not, depending on the 
check.

https://github.com/llvm/llvm-project/pull/119842
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [clang-tidy][doc][NFC] extract common global options in doc (PR #119842)

2024-12-13 Thread Congcong Cai via cfe-commits

https://github.com/HerrCai0907 updated 
https://github.com/llvm/llvm-project/pull/119842

>From efe9cd9e78988a531dfbb6387691819ec5c18ac3 Mon Sep 17 00:00:00 2001
From: Congcong Cai 
Date: Thu, 12 Dec 2024 00:30:25 +0800
Subject: [PATCH 1/2] [clang-tidy][doc][NFC] extract common global options in
 doc

---
 .../docs/clang-tidy/GlobalOptions.rst | 21 +++
 .../checks/abseil/string-find-startswith.rst  |  3 +--
 .../abseil/string-find-str-contains.rst   |  3 +--
 .../clang-tidy/checks/boost/use-ranges.rst|  3 +--
 .../cppcoreguidelines/avoid-do-while.rst  |  3 ++-
 .../cppcoreguidelines/init-variables.rst  |  3 +--
 .../pro-bounds-constant-array-index.rst   |  3 +--
 .../checks/misc/uniqueptr-reset-release.rst   |  3 +--
 .../checks/modernize/loop-convert.rst |  3 +--
 .../checks/modernize/make-shared.rst  |  6 ++
 .../checks/modernize/make-unique.rst  |  6 ++
 .../min-max-use-initializer-list.rst  |  3 +--
 .../checks/modernize/pass-by-value.rst|  3 +--
 .../checks/modernize/replace-auto-ptr.rst |  3 +--
 .../checks/modernize/type-traits.rst  |  2 +-
 .../checks/modernize/use-bool-literals.rst|  3 +--
 .../modernize/use-default-member-init.rst |  3 +--
 .../checks/modernize/use-equals-default.rst   |  1 +
 .../checks/modernize/use-equals-delete.rst|  3 +--
 .../checks/modernize/use-ranges.rst   |  3 +--
 .../checks/modernize/use-std-numbers.rst  |  3 +--
 .../clang-tidy/checks/modernize/use-using.rst |  3 +--
 .../performance/unnecessary-value-param.rst   |  3 +--
 .../avoid-const-params-in-decls.rst   |  3 +--
 .../checks/readability/const-return-type.rst  |  3 +--
 .../function-cognitive-complexity.rst |  5 +++--
 ...nconsistent-declaration-parameter-name.rst |  3 +--
 .../checks/readability/redundant-casting.rst  |  3 +--
 .../readability/redundant-declaration.rst |  3 +--
 .../readability/redundant-smartptr-get.rst|  4 ++--
 .../readability/simplify-boolean-expr.rst |  3 +--
 .../readability/uppercase-literal-suffix.rst  |  3 +--
 clang-tools-extra/docs/clang-tidy/index.rst   |  1 +
 33 files changed, 59 insertions(+), 62 deletions(-)
 create mode 100644 clang-tools-extra/docs/clang-tidy/GlobalOptions.rst

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 00..c717784eb2dff3
--- /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 41a7ab500d7ce0..a8b7b234cc7c23 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 `.
 
 .. 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 042fbdb3f29a94..4eedd8c0b57f0a 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 `.
 
 .. 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 4c032ad32f4fd8..847875b4df3b63 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 `.
 
 .. 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

[clang-tools-extra] [clang-tidy][doc][NFC] extract common global options in doc (PR #119842)

2024-12-13 Thread via cfe-commits

llvmbot wrote:




@llvm/pr-subscribers-clang-tools-extra

Author: Congcong Cai (HerrCai0907)


Changes



---

Patch is 20.60 KiB, truncated to 20.00 KiB below, full version: 
https://github.com/llvm/llvm-project/pull/119842.diff


33 Files Affected:

- (added) clang-tools-extra/docs/clang-tidy/GlobalOptions.rst (+21) 
- (modified) 
clang-tools-extra/docs/clang-tidy/checks/abseil/string-find-startswith.rst 
(+1-2) 
- (modified) 
clang-tools-extra/docs/clang-tidy/checks/abseil/string-find-str-contains.rst 
(+1-2) 
- (modified) clang-tools-extra/docs/clang-tidy/checks/boost/use-ranges.rst 
(+1-2) 
- (modified) 
clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/avoid-do-while.rst 
(+2-1) 
- (modified) 
clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/init-variables.rst 
(+1-2) 
- (modified) 
clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/pro-bounds-constant-array-index.rst
 (+1-2) 
- (modified) 
clang-tools-extra/docs/clang-tidy/checks/misc/uniqueptr-reset-release.rst 
(+1-2) 
- (modified) 
clang-tools-extra/docs/clang-tidy/checks/modernize/loop-convert.rst (+1-2) 
- (modified) clang-tools-extra/docs/clang-tidy/checks/modernize/make-shared.rst 
(+2-4) 
- (modified) clang-tools-extra/docs/clang-tidy/checks/modernize/make-unique.rst 
(+2-4) 
- (modified) 
clang-tools-extra/docs/clang-tidy/checks/modernize/min-max-use-initializer-list.rst
 (+1-2) 
- (modified) 
clang-tools-extra/docs/clang-tidy/checks/modernize/pass-by-value.rst (+1-2) 
- (modified) 
clang-tools-extra/docs/clang-tidy/checks/modernize/replace-auto-ptr.rst (+1-2) 
- (modified) clang-tools-extra/docs/clang-tidy/checks/modernize/type-traits.rst 
(+1-1) 
- (modified) 
clang-tools-extra/docs/clang-tidy/checks/modernize/use-bool-literals.rst (+1-2) 
- (modified) 
clang-tools-extra/docs/clang-tidy/checks/modernize/use-default-member-init.rst 
(+1-2) 
- (modified) 
clang-tools-extra/docs/clang-tidy/checks/modernize/use-equals-default.rst (+1) 
- (modified) 
clang-tools-extra/docs/clang-tidy/checks/modernize/use-equals-delete.rst (+1-2) 
- (modified) clang-tools-extra/docs/clang-tidy/checks/modernize/use-ranges.rst 
(+1-2) 
- (modified) 
clang-tools-extra/docs/clang-tidy/checks/modernize/use-std-numbers.rst (+1-2) 
- (modified) clang-tools-extra/docs/clang-tidy/checks/modernize/use-using.rst 
(+1-2) 
- (modified) 
clang-tools-extra/docs/clang-tidy/checks/performance/unnecessary-value-param.rst
 (+1-2) 
- (modified) 
clang-tools-extra/docs/clang-tidy/checks/readability/avoid-const-params-in-decls.rst
 (+1-2) 
- (modified) 
clang-tools-extra/docs/clang-tidy/checks/readability/const-return-type.rst 
(+1-2) 
- (modified) 
clang-tools-extra/docs/clang-tidy/checks/readability/function-cognitive-complexity.rst
 (+3-2) 
- (modified) 
clang-tools-extra/docs/clang-tidy/checks/readability/inconsistent-declaration-parameter-name.rst
 (+1-2) 
- (modified) 
clang-tools-extra/docs/clang-tidy/checks/readability/redundant-casting.rst 
(+1-2) 
- (modified) 
clang-tools-extra/docs/clang-tidy/checks/readability/redundant-declaration.rst 
(+1-2) 
- (modified) 
clang-tools-extra/docs/clang-tidy/checks/readability/redundant-smartptr-get.rst 
(+2-2) 
- (modified) 
clang-tools-extra/docs/clang-tidy/checks/readability/simplify-boolean-expr.rst 
(+1-2) 
- (modified) 
clang-tools-extra/docs/clang-tidy/checks/readability/uppercase-literal-suffix.rst
 (+1-2) 
- (modified) clang-tools-extra/docs/clang-tidy/index.rst (+1) 


``diff
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 00..c717784eb2dff3
--- /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 41a7ab500d7ce0..a8b7b234cc7c23 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 `.
 
 .. 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-co

[clang-tools-extra] [clang-tidy][doc][NFC] extract common global options in doc (PR #119842)

2024-12-13 Thread Congcong Cai via cfe-commits

https://github.com/HerrCai0907 created 
https://github.com/llvm/llvm-project/pull/119842

None

>From efe9cd9e78988a531dfbb6387691819ec5c18ac3 Mon Sep 17 00:00:00 2001
From: Congcong Cai 
Date: Thu, 12 Dec 2024 00:30:25 +0800
Subject: [PATCH] [clang-tidy][doc][NFC] extract common global options in doc

---
 .../docs/clang-tidy/GlobalOptions.rst | 21 +++
 .../checks/abseil/string-find-startswith.rst  |  3 +--
 .../abseil/string-find-str-contains.rst   |  3 +--
 .../clang-tidy/checks/boost/use-ranges.rst|  3 +--
 .../cppcoreguidelines/avoid-do-while.rst  |  3 ++-
 .../cppcoreguidelines/init-variables.rst  |  3 +--
 .../pro-bounds-constant-array-index.rst   |  3 +--
 .../checks/misc/uniqueptr-reset-release.rst   |  3 +--
 .../checks/modernize/loop-convert.rst |  3 +--
 .../checks/modernize/make-shared.rst  |  6 ++
 .../checks/modernize/make-unique.rst  |  6 ++
 .../min-max-use-initializer-list.rst  |  3 +--
 .../checks/modernize/pass-by-value.rst|  3 +--
 .../checks/modernize/replace-auto-ptr.rst |  3 +--
 .../checks/modernize/type-traits.rst  |  2 +-
 .../checks/modernize/use-bool-literals.rst|  3 +--
 .../modernize/use-default-member-init.rst |  3 +--
 .../checks/modernize/use-equals-default.rst   |  1 +
 .../checks/modernize/use-equals-delete.rst|  3 +--
 .../checks/modernize/use-ranges.rst   |  3 +--
 .../checks/modernize/use-std-numbers.rst  |  3 +--
 .../clang-tidy/checks/modernize/use-using.rst |  3 +--
 .../performance/unnecessary-value-param.rst   |  3 +--
 .../avoid-const-params-in-decls.rst   |  3 +--
 .../checks/readability/const-return-type.rst  |  3 +--
 .../function-cognitive-complexity.rst |  5 +++--
 ...nconsistent-declaration-parameter-name.rst |  3 +--
 .../checks/readability/redundant-casting.rst  |  3 +--
 .../readability/redundant-declaration.rst |  3 +--
 .../readability/redundant-smartptr-get.rst|  4 ++--
 .../readability/simplify-boolean-expr.rst |  3 +--
 .../readability/uppercase-literal-suffix.rst  |  3 +--
 clang-tools-extra/docs/clang-tidy/index.rst   |  1 +
 33 files changed, 59 insertions(+), 62 deletions(-)
 create mode 100644 clang-tools-extra/docs/clang-tidy/GlobalOptions.rst

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 00..c717784eb2dff3
--- /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 41a7ab500d7ce0..a8b7b234cc7c23 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 `.
 
 .. 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 042fbdb3f29a94..4eedd8c0b57f0a 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 `.
 
 .. 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 4c032ad32f4fd8..847875b4df3b63 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 `.
 
 .. 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/avoi