-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[clang-tidy][doc][NFC] extract common global options in doc #119842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This option does not have any meaning in this context. Therefore I believe it should be kept local. |
||
|
|
||
| When `true`, some checkers will be more stringent. The default value depends | ||
| on the checks. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,7 +26,8 @@ Options | |
|
|
||
| .. option:: IgnoreMacros | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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. |
||
| 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++ | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,7 @@ See also: | |
| :maxdepth: 1 | ||
|
|
||
| The list of clang-tidy checks <checks/list> | ||
| The list of clang-tidy global options <GlobalOptions> | ||
| Clang-tidy IDE/Editor Integrations <Integrations> | ||
| Getting Involved <Contributing> | ||
| External Clang-Tidy Examples <ExternalClang-TidyExamples> | ||
|
Comment on lines
12
to
16
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just a drive-by comment, noticed this list sometimes uses clang-tidy, sometimes Clang-Tidy.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the root cause is the style of titles. Some titles uppercase each word some not. |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 for every check?