Skip to content

Commit cf60650

Browse files
committed
fix merge conflict
2 parents e9c7ef6 + a652590 commit cf60650

File tree

60 files changed

+489
-215
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+489
-215
lines changed

docs/ai/tensorflow-vm.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ms.workload:
1616

1717
# Train a TensorFlow model in the cloud
1818

19-
In this tutorial, we will train a TensorFlow model using the [MNIST dataset](http://yann.lecun.com/exdb/mnist/) in an Azure [Deep Learning](https://docs.microsoft.com/azure/machine-learning/data-science-virtual-machine/deep-learning-dsvm-overview) virtual machine.
19+
In this tutorial, we will train a TensorFlow model using the [MNIST dataset](http://yann.lecun.com/exdb/mnist/) on an Azure [Deep Learning](https://docs.microsoft.com/azure/machine-learning/data-science-virtual-machine/deep-learning-dsvm-overview) virtual machine.
2020

2121
The MNIST database has a training set of 60,000 examples, and a test set of 10,000 examples of handwritten digits.
2222

@@ -38,7 +38,7 @@ echo -e ". /etc/profile\n$(cat ~/.bashrc)" > ~/.bashrc
3838

3939
### Download sample code
4040

41-
Download this [GitHub repository](https://github.com/Microsoft/samples-for-ai) containing samples for getting started with deep learning across TensorFlow, CNTK, Theano, and more.
41+
Download this [GitHub repository](https://github.com/Microsoft/samples-for-ai) containing samples for getting started with deep learning on TensorFlow, CNTK, Theano, and more.
4242

4343
## Open project
4444

@@ -80,4 +80,4 @@ Stop the VM if you plan on using it in the near future. If you are finished with
8080

8181
```azurecli-interactive
8282
az group delete --name myResourceGroup
83-
```
83+
```

docs/code-quality/TOC.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Overview
22
## [Code Analysis for Managed Code](code-analysis-for-managed-code-overview.md)
3+
## [Roslyn Analyzers](roslyn-analyzers-overview.md)
34
## [Code Analysis for C/C++](code-analysis-for-c-cpp-overview.md)
45
## [Measure Code Maintainability with Code Metrics](code-metrics-values.md)
56
# Quickstarts
@@ -11,6 +12,8 @@
1112
## [Configure and Use a Custom Rule Set](walkthrough-configuring-and-using-a-custom-rule-set.md)
1213
# How-to guides
1314
## Code Analysis for Managed Code
15+
### [Install Roslyn Analyzers](install-roslyn-analyzers.md)
16+
### [Configure and Use Roslyn Analyzers](use-roslyn-analyzers.md)
1417
### [Enable Automatic Code Analysis](how-to-enable-and-disable-automatic-code-analysis-for-managed-code.md)
1518
### [Enable Full Solution Analysis](how-to-enable-and-disable-full-solution-analysis-for-managed-code.md)
1619
### [Automatic feature suspension](automatic-feature-suspension.md)

docs/code-quality/code-analysis-for-managed-code-overview.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
11
---
2-
title: "Code Analysis for Managed Code Overview | Microsoft Docs"
3-
ms.custom: ""
4-
ms.date: "11/04/2016"
5-
ms.reviewer: ""
6-
ms.suite: ""
2+
title: "Code analysis for managed code in Visual Studio | Microsoft Docs"
3+
ms.date: 03/26/2018
74
ms.technology: vs-ide-code-analysis
8-
ms.tgt_pltfrm: ""
9-
ms.topic: "article"
10-
f1_keywords:
5+
ms.topic: conceptual
6+
f1_keywords:
117
- "vs.projectpropertypages.codeanalysis"
12-
helpviewer_keywords:
8+
helpviewer_keywords:
139
- "code analysis, managed code"
1410
- "managed code, code analysis"
1511
author: "gewarren"
1612
ms.author: "gewarren"
1713
manager: ghogen
18-
ms.workload:
14+
ms.workload:
1915
- "dotnet"
2016
---
21-
# Code analysis for managed code overview
17+
# Overview of code analysis for managed code
18+
19+
Visual Studio 2017 analyzes managed code in two ways: with legacy *FxCop* static analysis of managed assemblies, and with .NET Compiler Platform *analyzers*. This topic covers FxCop static code analysis. To learn more about analyzing code by using .NET Compiler Platform analyzers, see [Overview of Roslyn analyzers](../code-quality/roslyn-analyzers-overview.md).
2220

2321
Code analysis for managed code analyzes managed assemblies and reports information about the assemblies, such as violations of the programming and design rules set forth in the Microsoft .NET Framework Design Guidelines.
2422

@@ -71,5 +69,6 @@ You can use the integrated features of the build system to run the analysis tool
7169

7270
## See also
7371

74-
[Using Rule Sets to Group Code Analysis Rules](../code-quality/using-rule-sets-to-group-code-analysis-rules.md)
75-
[How to: Enable and Disable Automatic Code Analysis](../code-quality/how-to-enable-and-disable-automatic-code-analysis-for-managed-code.md)
72+
- [Overview of Roslyn analyzers](../code-quality/roslyn-analyzers-overview.md)
73+
- [Using Rule Sets to Group Code Analysis Rules](../code-quality/using-rule-sets-to-group-code-analysis-rules.md)
74+
- [How to: Enable and Disable Automatic Code Analysis](../code-quality/how-to-enable-and-disable-automatic-code-analysis-for-managed-code.md)

docs/code-quality/in-source-suppression-overview.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
---
22
title: "Suppress code analysis warnings in Visual Studio | Microsoft Docs"
3-
ms.custom: ""
43
ms.date: 01/29/2018
5-
ms.reviewer: ""
6-
ms.suite: ""
74
ms.technology: vs-ide-code-analysis
85
ms.topic: "article"
9-
helpviewer_keywords:
6+
helpviewer_keywords:
107
- "source suppression, code analysis"
118
- "code analysis, source suppression"
129
author: "gewarren"
@@ -16,10 +13,10 @@ dev_langs:
1613
- CSharp
1714
- VB
1815
- CPP
19-
ms.workload:
16+
ms.workload:
2017
- "multiple"
2118
---
22-
# Suppressing code analysis warnings
19+
# Suppress code analysis warnings
2320

2421
It is often useful to indicate that a warning is not applicable. This indicates to team members that the code was reviewed, and that the warning can be suppressed. In-source suppression (ISS) uses the <xref:System.Diagnostics.CodeAnalysis.SuppressMessageAttribute> attribute to suppress a warning. The attribute can be placed close to the code segment that generated the warning. You can add the <xref:System.Diagnostics.CodeAnalysis.SuppressMessageAttribute> attribute to the source file by typing it in, or you can use the shortcut menu on a warning in the **Error List** to add it automatically.
2522

@@ -89,7 +86,7 @@ If there are strict performance reasons for minimizing in-source suppression met
8986
9087
For maintainability reasons, omitting the rule name is not recommended.
9188
92-
## Suppressing selective violations within a method body
89+
## Suppress selective violations within a method body
9390
9491
Suppression attributes can be applied to a method, but cannot be embedded within a method body. This means that all violations of a particular rule are suppressed if you add the <xref:System.Diagnostics.CodeAnalysis.SuppressMessageAttribute> attribute to the method.
9592
@@ -163,4 +160,5 @@ The global suppression file maintains suppressions that are either global-level
163160

164161
## See also
165162

166-
<xref:System.Diagnostics.CodeAnalysis>
163+
- <xref:System.Diagnostics.CodeAnalysis>
164+
- [Use Roslyn analyzers](../code-quality/use-roslyn-analyzers.md)
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
title: "Install Roslyn analyzers in Visual Studio | Microsoft Docs"
3+
ms.date: 03/26/2018
4+
ms.technology: vs-ide-code-analysis
5+
ms.topic: conceptual
6+
helpviewer_keywords:
7+
- "code analysis, managed code"
8+
- "analyzers"
9+
- "Roslyn analyzers"
10+
author: "gewarren"
11+
ms.author: "gewarren"
12+
manager: ghogen
13+
ms.workload:
14+
- "dotnet"
15+
---
16+
# Install .NET Compiler Platform analyzers
17+
18+
Visual Studio 2017 includes a core set of .NET Compiler Platform (*Roslyn*) analyzers. These analyzers are always on. You can install additional analyzers either as NuGet packages, or as Visual Studio extensions in *VSIX* files.
19+
20+
## To install NuGet package analyzers
21+
22+
1. [Determine which analyzer package version](https://github.com/dotnet/roslyn-analyzers#recommended-version-of-analyzer-packages) to install, based on your version of Visual Studio.
23+
24+
1. Install the package in Visual Studio, using either the [Package Manager Console](/nuget/quickstart/install-and-use-a-package-in-visual-studio#package-manager-console) or the [Package Manager UI](/nuget/quickstart/install-and-use-a-package-in-visual-studio#package-manager-console).
25+
26+
> [!NOTE]
27+
> The nuget.org page for each analyzer package shows you the command to paste into the **Package Manager Console**. There's even a handy button to copy the text to the clipboard.
28+
>
29+
> ![NuGet.org page showing Package Manager Console command](media/nuget-package-manager-command.png)
30+
31+
The analyzer assemblies are installed and appear in **Solution Explorer** under **References** > **Analyzers**.
32+
33+
![Analyzers node in Solution Explorer](media/solution-explorer-analyzers-node.png)
34+
35+
## To install VSIX analyzers
36+
37+
1. In Visual Studio, select **Tools** > **Extensions and Updates**.
38+
39+
The **Extensions and Updates** dialog box opens.
40+
41+
> [!NOTE]
42+
> Alternatively, download the extension directly from [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=VisualStudioPlatformTeam.MicrosoftCodeAnalysis2017).
43+
44+
1. Expand **Online** in the left pane, and then select **Visual Studio Marketplace**.
45+
46+
1. In the search box, type "code analysis", and look for the **Microsoft Code Analysis 2017** extension.
47+
48+
![Microsoft Code Analysis extension](media/extensions-and-updates-code-analysis.png)
49+
50+
1. Select **Download**.
51+
52+
The extension is downloaded.
53+
54+
1. Select **OK** to close the dialog box, and then close all instances of Visual Studio to launch the **VSIX Installer**.
55+
56+
The **VSIX Installer** dialog box opens.
57+
58+
![VSIX installer for Microsoft Code Analysis](media/vsix-installer-code-analysis.png)
59+
60+
1. Select **Modify** to start the installation.
61+
62+
1. After a minute or two, the installation completes. Select **Close**.
63+
64+
1. Open Visual Studio again.
65+
66+
If you want to check whether the extension is installed, select **Tools** > **Extensions and Updates**. In the **Extensions and Updates** dialog box, select the **Installed** category on the left, and then search for the extension by name.
67+
68+
## Next steps
69+
70+
- [Use Roslyn analyzers in Visual Studio](../code-quality/use-roslyn-analyzers.md)
71+
72+
## See also
73+
74+
- [Overview of Roslyn analyzers in Visual Studio](../code-quality/roslyn-analyzers-overview.md)
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
title: "Roslyn analyzers in Visual Studio | Microsoft Docs"
3+
ms.date: 03/26/2018
4+
ms.technology: vs-ide-code-analysis
5+
ms.topic: conceptual
6+
helpviewer_keywords:
7+
- "code analysis, managed code"
8+
- "analyzers"
9+
- "Roslyn analyzers"
10+
author: "gewarren"
11+
ms.author: "gewarren"
12+
manager: ghogen
13+
ms.workload:
14+
- "dotnet"
15+
---
16+
# Overview of .NET Compiler Platform analyzers
17+
18+
Visual Studio 2017 includes a built-in set of .NET Compiler Platform analyzers that analyze your C# or Visual Basic code as you type. You can install additional analyzers as a Visual Studio extension, or on a per-project basis as a NuGet package. Analyzers look at code style, code quality and maintainability, code design, and other issues.
19+
20+
If rule violations are found by an analyzer, they are reported both in the code editor as a *squiggly* under the offending code, and in the **Error List**.
21+
22+
Many analyzer rules, or *diagnostics*, have one or more associated *code fixes* that you can apply to correct the problem. The analyzer diagnostics that are built into Visual Studio each have an associated code fix. Code fixes are shown in the light bulb icon menu, along with other types of *Quick Actions*. For information about these code fixes, see [Common Quick Actions](../ide/common-quick-actions.md).
23+
24+
![Analyzer violation and Quick Action code fix](../code-quality/media/built-in-analyzer-code-fix.png)
25+
26+
## Roslyn analyzers vs. static code analysis
27+
28+
.NET Compiler Platform ("Roslyn") analyzers will eventually replace [static code analysis](../code-quality/code-analysis-for-managed-code-overview.md) for managed code. Many of the static code analysis rules have already been rewritten as Roslyn analyzer diagnostics.
29+
30+
Like static code analysis rule violations, Roslyn analyzer violations appear in the **Error List**. In addition, Roslyn analyzer violations also show up in the code editor as *squigglies* under the offending code. The color of the squiggly depends on the [severity setting](../code-quality/use-roslyn-analyzers.md#rule-severity) of the rule. The following screenshot shows three violations&mdash;one red, one green, and one gray:
31+
32+
![Squigglies in the code editor](media/diagnostics-severity-colors.png)
33+
34+
Roslyn analyzers analyze code at build time, like static code analysis if it's enabled, but also live as you type! Roslyn analyzers can also provide design-time analysis of code files that aren't open in the editor if you enable [full solution analysis](../code-quality/how-to-enable-and-disable-full-solution-analysis-for-managed-code.md#to-toggle-full-solution-analysis).
35+
36+
> [!NOTE]
37+
> Build-time errors and warnings from Roslyn analyzers are shown only if the analyzers are installed as a NuGet package.
38+
39+
Not only do Roslyn analyzers report the same types of problems that static code analysis does, but they make it easy for you to fix one, or all, occurrences of the violation in your file or project. These actions are called *code fixes*. Code fixes are IDE-specific; in Visual Studio, they are implemented as [Quick Actions](../ide/quick-actions.md). Not all analyzer diagnostics have an associated code fix.
40+
41+
> [!NOTE]
42+
> The menu option **Analyze** > **Run Code Analysis** applies only to static code analysis. Additionally, on a project's **Code Analysis** property page, the **Enable Code Analysis on Build** and **Suppress results from generated code** checkboxes apply only to static code analysis. They have no effect on Roslyn analyzers.
43+
44+
To differentiate between violations from Roslyn analyzers and static code analysis in the **Error List**, look at the **Tool** column. If the Tool value matches one of the analyzer assemblies in **Solution Explorer**, for example **Microsoft.CodeQuality.Analyzers**, the violation comes from a Roslyn analyzer. Otherwise, the violation originates from static code analysis.
45+
46+
![Tool column in Error List](media/code-analysis-tool-in-error-list.png)
47+
48+
## NuGet package vs. extension
49+
50+
.NET Compiler Platform analyzers can be installed per-project via a NuGet package, or Visual Studio-wide as a Visual Studio extension. There are some key behavior differences between these two methods of [installing analyzers](../code-quality/install-roslyn-analyzers.md).
51+
52+
### Scope
53+
54+
If you install analyzers as a Visual Studio extension, they apply at the solution level, to all instances of Visual Studio. If you install the analyzers as a NuGet package, which is the preferred method, they apply only to the project where the NuGet package was installed. In team environments, analyzers installed as NuGet packages are in scope for *all developers* that work on that project.
55+
56+
### Build errors
57+
58+
To have rules enforced at build time, including through the command line or as part of a continuous integration (CI) build, install the analyzers as a NuGet package. Analyzer warnings and errors don't show up in the build report if you install the analyzers as an extension.
59+
60+
The following screenshot shows the command-line build output from building a project that contains an analyzer rule violation:
61+
62+
![MSBuild output with rule violation](media/command-line-build-analyzers.png)
63+
64+
### Rule severity
65+
66+
You cannot set the severity of rules from analyzers that were installed as a Visual Studio extension. To configure [rule severity](../code-quality/use-roslyn-analyzers.md#rule-severity), install the analyzers as a NuGet package.
67+
68+
## Next steps
69+
70+
- [Install Roslyn analyzers in Visual Studio](../code-quality/install-roslyn-analyzers.md)
71+
- [Use Roslyn analyzers in Visual Studio](../code-quality/use-roslyn-analyzers.md)
72+
73+
## See also
74+
75+
- [Quick Actions in Visual Studio](../ide/quick-actions.md)
76+
- [Write your own Roslyn analyzer](../extensibility/getting-started-with-roslyn-analyzers.md)
77+
- [.NET Compiler Platform SDK](/dotnet/csharp/roslyn-sdk/)

0 commit comments

Comments
 (0)