Skip to content

Commit 5221079

Browse files
author
Colin Robertson
committed
Update /analyze per review
1 parent c415af7 commit 5221079

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

docs/build/reference/analyze-code-analysis.md

+14-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "/analyze (Code analysis)"
33
description: "The Microsoft C++ compiler /analyze option syntax and usage."
4-
ms.date: 05/12/2021
4+
ms.date: 05/21/2021
55
f1_keywords: ["VC.Project.VCCLCompilerTool.EnablePREfast", "/analyze", "VC.Project.VCCLCompilerTool.PREfastAdditionalOptions", "VC.Project.VCCLCompilerTool.PREfastAdditionalPlugins"]
66
helpviewer_keywords: ["/analyze compiler option [C++]", "-analyze compiler option [C++]", "analyze compiler option [C++]"]
77
ms.assetid: 81da536a-e030-4bd4-be18-383927597d08
@@ -53,13 +53,13 @@ Log file content options:
5353
::: moniker range="msvc-150"
5454

5555
Ruleset options:
56-
> **`/analyze:ruleset`** *ruleset_files*
56+
> **`/analyze:ruleset`** *ruleset_file*
5757
5858
::: moniker-end
5959

6060
::: moniker range=">=msvc-160"
6161

62-
Ruleset location options:
62+
Ruleset options:
6363
> **`/analyze:projectdirectory`** *`project_directory`*\
6464
> **`/analyze:rulesetdirectory`** *`ruleset_directories`*\
6565
> **`/analyze:ruleset`** *`ruleset_files`*
@@ -191,28 +191,33 @@ Adds both suppressed warnings and unsuppressed warnings to the analysis log file
191191

192192
::: moniker-end
193193

194-
::: moniker range="msvc-150"
194+
::: moniker range=">=msvc-150"
195195

196196
#### Ruleset options
197197

198198
::: moniker-end
199199

200200
::: moniker range=">=msvc-160"
201201

202-
#### Ruleset location options
203-
204202
**`/analyze:projectdirectory`** *`project_directory`*\
205203
Specifies the current project directory. If the ruleset (or an item it includes) is a file name, the compiler first looks for the file under the specified *`project_directory`*. If not found, it next searches the *`ruleset_directories`* specified by **`/analyze:rulesetdirectory`**, if any. If the ruleset (or an item it includes) is a relative path, the compiler first looks for the file under the project directory. If the ruleset isn't found, then it looks in the current working directory. This option is available starting in Visual Studio 2019 version 16.9.
206204

207205
**`/analyze:rulesetdirectory`** *`ruleset_directories`*\
208206
Specifies a semicolon-separated list of ruleset search paths. If the ruleset (or an item it includes) is a file name, then the compiler first looks for the file under the *`project_directory`* specified by **`/analyze:projectdirectory`**, if any, followed by the specified *`ruleset_directories`*. This option is available starting in Visual Studio 2019 version 16.9.
209207

208+
**`/analyze:ruleset`** *`ruleset_files`*\
209+
Specifies one or more ruleset files to use for analysis. This option can make analysis more efficient. That's because the analysis engine tries to exclude checkers that have no active rules specified in the ruleset files before running. Otherwise, the engine runs all checkers enabled.
210+
210211
::: moniker-end
211212

212-
::: moniker range=">=msvc-150"
213+
::: moniker range="msvc-150"
213214

214-
**`/analyze:ruleset`** *`ruleset_files`*\
215-
Specifies one or more ruleset files to use for analysis. This option can make analysis more efficient. That's because the analysis engine tries to exclude checkers that have no active rules specified in the ruleset files before running. Otherwise, the engine runs all checkers enabled.
215+
**`/analyze:ruleset`** *`ruleset_file`*\
216+
Specifies a ruleset file to use for analysis. This option can make analysis more efficient. That's because the analysis engine tries to exclude checkers that have no active rules specified in the ruleset file before running. Otherwise, the engine runs all checkers enabled.
217+
218+
::: moniker-end
219+
220+
::: moniker range=">=msvc-150"
216221

217222
The ruleset files that ship with Visual Studio are found in *`%VSINSTALLDIR%\Team Tools\Static Analysis Tools\Rule Sets`*.
218223

0 commit comments

Comments
 (0)