Skip to content

Commit 928885a

Browse files
authored
Merge pull request #1918 from MicrosoftDocs/master
4/26 AM Publish
2 parents e13e61d + 7a910df commit 928885a

File tree

144 files changed

+2135
-368
lines changed

Some content is hidden

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

144 files changed

+2135
-368
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/.vs/
2+
/.vscode/
23
log/
34
obj/
45
_site/

.vscode/settings.json

Lines changed: 0 additions & 2 deletions
This file was deleted.

connected-environment/how-to/use-a-custom-nuget-feed.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ author: "ghogen"
44
ms.author: "ghogen"
55
ms.date: "03/27/2018"
66
ms.topic: "conceptual"
7+
ms.prod: visual-studio-dev15
8+
ms.technology: vs-azure
79
description: "Use a custom NuGet feed to access and use NuGet packages in a connected environment."
810
keywords: "Docker, Kubernetes, Azure, AKS, Azure Container Service, containers"
911
manager: "douge"

connected-environment/includes/build-and-run-in-k8s-cli.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
---
2+
ms.topic: "include"
3+
---
14
## Build and run code in Kubernetes
25
Let's run our code! In the terminal window, run this command from the **root code folder**, webfrontend:
36

connected-environment/includes/clean-up.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
---
2+
ms.topic: "include"
3+
---
14
## Clean Up
25
To completely delete a Connected Environment in Azure, including all the running services within it, use the `vsce env rm` command. Please bear in mind that this action is irreversible.
36

connected-environment/includes/common-test.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
---
2+
ms.topic: "include"
3+
---
14
### This is a common section
25

36
Here is some content.

connected-environment/includes/create-env-cli.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
---
2+
ms.topic: "include"
3+
---
14
## Create a Kubernetes development environment in Azure
25
With Connected Environment, you can create Kubernetes-based environments that are fully managed by Azure and optimized for development. The command creates an environment named `mydevenvironment` in `eastus`.
36
```cmd

connected-environment/includes/debug-intro.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
---
2+
ms.topic: "include"
3+
---
14
In this section, we'll use VS Code to directly debug our container running in Azure. We'll also learn how to get a faster edit-run-test loop.
25

36
![](../media/edit-refresh-see.png)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1+
---
2+
ms.topic: "include"
3+
---
14
## Ensure the development environment was successfully created
25
In the previous section, we kicked off the `vsce env create` command to create a development environment in Azure. It can take about 7 minutes to complete, so check back that it was successfully created. You can always check the environments you have access to, and their status, with this command: `vsce env list`.

connected-environment/includes/init-debug-assets-vscode.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
---
2+
ms.topic: "include"
3+
---
14
## Initialize debug assets with the VS Code extension
25
We first need to configure our code project so VS Code will communicate with our development environment in Azure. The VS Code extension for Connected Environment provides a helper command to set up debug configuration.
36

connected-environment/includes/install-cli-and-vscode.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
---
2+
ms.topic: "include"
3+
---
14
## Install the Connected Environment CLI
25
Connected Environment requires minimal local machine setup. Most of your development environment's configuration gets stored in the cloud, and is shareable with other users.
36

connected-environment/includes/learning-objectives.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
---
2+
ms.topic: "include"
3+
---
14
In this guide, you will learn how to:
25

36
1. Create a Kubernetes-based environment in Azure that is optimized for development.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1+
---
2+
ms.topic: "include"
3+
---
14
> [!Note]
25
> **If you get stuck** at any time, see the [Troubleshooting](../troubleshooting.md) section, or post a comment on this page.

connected-environment/includes/sign-into-azure.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
---
2+
ms.topic: "include"
3+
---
14
## Sign in to Azure
25
We'll need to sign in to Azure to create our development environment. Type the following command in a terminal window:
36
```cmd

connected-environment/includes/take-survey.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
---
2+
ms.topic: "include"
3+
---
14
**Your voice is a critical part of our product development process.** Please give us your [feedback](https://aka.ms/vsce-product-survey).
25

36
> [!div class="nextstepaction"]

connected-environment/includes/team-development-1.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
---
2+
ms.topic: "include"
3+
---
14
So far we've run our application's code as if we were the only developer working on the app. In this section, we'll learn how Connected Environment streamlines team development:
25
* Enable a team of developers to work in the same development environment.
36
* Supports each developer iterating on their code in isolation and without fear of breaking others.

connected-environment/includes/team-development-2.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
---
2+
ms.topic: "include"
3+
---
14
2. Hit F5 (or type `vsce up` in the Terminal Window) to run the service. Doing this will automatically run it in our newly selected space `scott`.
25
1. We can confirm this by running `vsce list` again. First, you'll notice an instance of `mywebapi` is now running in the `scott` space (the version running in the `mainline` is still running but it is not listed). Secondly, the access point URL for `webfrontend` is prefixed with the text "scott-". This URL is unique to the `scott` space, and signifies that requests sent to the "scott URL" will attempt to first route to services in the `scott` space, and will fall back to services in the `mainline` space.
36

connected-environment/includes/tip-vscode-status-bar-url.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
---
2+
ms.topic: "include"
3+
---
14
> [!Tip]
25
> The VS Code status bar will display a clickable URL.
36

connected-environment/includes/vsce-init.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
---
2+
ms.topic: "include"
3+
---
14
## Initialize code for Docker and Kubernetes development
25
So far, we have a basic web app that can run locally. We'll now containerize it by creating assets that define the app's container and how it will deploy to Kubernetes. This is easy to do with Connected Environment:
36

connected-environment/includes/well-done.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
---
2+
ms.topic: "include"
3+
---
14
## Well done!
25
You've completed the getting started guide! You learned how to:
36

docs/code-quality/TOC.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#### [Specify When and Where an Annotation Applies](specifying-when-and-where-an-annotation-applies.md)
3535
#### [Intrinsic Functions](intrinsic-functions.md)
3636
#### [Best Practices and Examples (SAL)](best-practices-and-examples-sal.md)
37-
### [Specify Additional Code Information by Using __analysis_assume](how-to-specify-additional-code-information-by-using-analysis-assume.md)
37+
### [Specify Additional Code Information by Using _Analysis_assume](how-to-specify-additional-code-information-by-using-analysis-assume.md)
3838
## [Rule Sets](using-rule-sets-to-group-code-analysis-rules.md)
3939
### [Rule Sets for Managed Code](how-to-configure-code-analysis-for-a-managed-code-project.md)
4040
#### [Configure Code Analysis for an ASP.NET Web Application](how-to-configure-code-analysis-for-an-aspnet-web-application.md)

docs/code-quality/ca2217-do-not-mark-enums-with-flagsattribute.md

Lines changed: 34 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ f1_keywords:
1010
helpviewer_keywords:
1111
- "DoNotMarkEnumsWithFlags"
1212
- "CA2217"
13+
dev_langs:
14+
- "VB"
15+
- "CSharp"
16+
- "CPP"
1317
ms.assetid: 1b6f626c-66bf-45b0-a3e2-7c41ee9ceda7
1418
author: gewarren
1519
ms.author: gewarren
@@ -18,6 +22,7 @@ ms.workload:
1822
- "multiple"
1923
---
2024
# CA2217: Do not mark enums with FlagsAttribute
25+
2126
|||
2227
|-|-|
2328
|TypeName|DoNotMarkEnumsWithFlags|
@@ -26,33 +31,41 @@ ms.workload:
2631
|Breaking Change|Non Breaking|
2732

2833
## Cause
29-
An externally visible enumeration is marked with <xref:System.FlagsAttribute> and it has one or more values that are not powers of two or a combination of the other defined values on the enumeration.
3034

31-
## Rule Description
32-
An enumeration should have <xref:System.FlagsAttribute> present only if each value defined in the enumeration is a power of two, or a combination of defined values.
35+
An externally visible enumeration is marked with <xref:System.FlagsAttribute>, and it has one or more values that are not powers of two or a combination of the other defined values on the enumeration.
36+
37+
## Rule description
38+
39+
An enumeration should have <xref:System.FlagsAttribute> present only if each value defined in the enumeration is a power of two or a combination of defined values.
40+
41+
## How to fix violations
42+
43+
To fix a violation of this rule, remove <xref:System.FlagsAttribute> from the enumeration.
44+
45+
## When to suppress warnings
46+
47+
Do not suppress a warning from this rule.
48+
49+
## Example that should not have the attribute
50+
51+
The following example shows an enumeration, `Color`, that contains the value 3. 3 is not a power of two, or a combination of any of the defined values. The `Color` enumeration shouldn't be marked with <xref:System.FlagsAttribute>.
3352

34-
## How to Fix Violations
35-
To fix a violation of this rule, remove <xref:System.FlagsAttribute> from the enumeration.
53+
[!code-cpp[FxCop.Usage.EnumNoFlags#1](../code-quality/codesnippet/CPP/ca2217-do-not-mark-enums-with-flagsattribute_1.cpp)]
54+
[!code-csharp[FxCop.Usage.EnumNoFlags#1](../code-quality/codesnippet/CSharp/ca2217-do-not-mark-enums-with-flagsattribute_1.cs)]
55+
[!code-vb[FxCop.Usage.EnumNoFlags#1](../code-quality/codesnippet/VisualBasic/ca2217-do-not-mark-enums-with-flagsattribute_1.vb)]
3656

37-
## When to Suppress Warnings
38-
Do not suppress a warning from this rule.
57+
## Example that should have the attribute
3958

40-
## Example
41-
The following example shows an enumeration, Color, that contains the value 3, which is neither a power of two, nor a combination of any of the defined values. The Color enumeration should not be marked with the <xref:System.FlagsAttribute>.
59+
The following example shows an enumeration, `Days`, that meets the requirements for being marked with <xref:System.FlagsAttribute>.
4260

43-
[!code-cpp[FxCop.Usage.EnumNoFlags#1](../code-quality/codesnippet/CPP/ca2217-do-not-mark-enums-with-flagsattribute_1.cpp)]
44-
[!code-csharp[FxCop.Usage.EnumNoFlags#1](../code-quality/codesnippet/CSharp/ca2217-do-not-mark-enums-with-flagsattribute_1.cs)]
45-
[!code-vb[FxCop.Usage.EnumNoFlags#1](../code-quality/codesnippet/VisualBasic/ca2217-do-not-mark-enums-with-flagsattribute_1.vb)]
61+
[!code-cpp[FxCop.Usage.EnumNoFlags2#1](../code-quality/codesnippet/CPP/ca2217-do-not-mark-enums-with-flagsattribute_2.cpp)]
62+
[!code-csharp[FxCop.Usage.EnumNoFlags2#1](../code-quality/codesnippet/CSharp/ca2217-do-not-mark-enums-with-flagsattribute_2.cs)]
63+
[!code-vb[FxCop.Usage.EnumNoFlags2#1](../code-quality/codesnippet/VisualBasic/ca2217-do-not-mark-enums-with-flagsattribute_2.vb)]
4664

47-
## Example
48-
The following example shows an enumeration, Days, that meets the requirements for being marked with the System.FlagsAttribute.
65+
## Related rules
4966

50-
[!code-cpp[FxCop.Usage.EnumNoFlags2#1](../code-quality/codesnippet/CPP/ca2217-do-not-mark-enums-with-flagsattribute_2.cpp)]
51-
[!code-csharp[FxCop.Usage.EnumNoFlags2#1](../code-quality/codesnippet/CSharp/ca2217-do-not-mark-enums-with-flagsattribute_2.cs)]
52-
[!code-vb[FxCop.Usage.EnumNoFlags2#1](../code-quality/codesnippet/VisualBasic/ca2217-do-not-mark-enums-with-flagsattribute_2.vb)]
67+
[CA1027: Mark enums with FlagsAttribute](../code-quality/ca1027-mark-enums-with-flagsattribute.md)
5368

54-
## Related Rules
55-
[CA1027: Mark enums with FlagsAttribute](../code-quality/ca1027-mark-enums-with-flagsattribute.md)
69+
## See also
5670

57-
## See Also
58-
<xref:System.FlagsAttribute?displayProperty=fullName>
71+
- <xref:System.FlagsAttribute?displayProperty=fullName>

docs/code-quality/code-analysis-for-c-cpp-overview.md

Lines changed: 34 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Code Analysis for C/C++ Overview
3-
ms.date: 11/04/2016
3+
ms.date: 04/28/2018
44
ms.prod: visual-studio-dev15
55
ms.technology: vs-ide-code-analysis
66
ms.topic: conceptual
@@ -26,29 +26,47 @@ ms.workload:
2626
---
2727
# Code analysis for C/C++ overview
2828

29-
The C/C++ Code Analysis tool provides information to developers about possible defects in their C/C++ source code. Common coding errors reported by the tool include buffer overruns, un-initialized memory, null pointer dereferences, and memory and resource leaks.
29+
The C/C++ Code Analysis tool provides information about possible defects in your C/C++ source code. Common coding errors reported by the tool include buffer overruns, uninitialized memory, null pointer dereferences, and memory and resource leaks. The tool can also run checks against the [C++ Core Guidelines](http://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md).
3030

31-
## IDE (integrated development environment) Integration
32-
To make it natural for developers to use the analysis tool, it is fully integrated within the [!INCLUDE[vsprvs](../code-quality/includes/vsprvs_md.md)] IDE. During the build process, any warnings generated for the source code appear in the Error List. You can navigate to source code that caused the warning, and you can view additional information about the cause and possible solutions of the issue.
31+
## IDE (integrated development environment) integration
3332

34-
## #pragma Support
35-
Developers can use the `#pragma` directive to treat warnings as errors; enable or disable warnings, and suppress warnings for individual lines of code. For more information, see [How to: Set Code Analysis Properties for C/C++ Projects ](how-to-set-code-analysis-properties-for-c-cpp-projects.md).
33+
The code analysis tool is fully integrated within the Visual Studio IDE.
3634

37-
## Annotation Support
38-
Annotations improve the accuracy of the code analysis. Annotations provide additional information about pre- and post- conditions on function parameters and return types. For more information, see [How to: Specify Additional Code Information by Using __analysis_assume](../code-quality/how-to-specify-additional-code-information-by-using-analysis-assume.md)
35+
During the build process, any warnings generated for the source code appear in the Error List. You can navigate to source code that caused the warning, and you can view additional information about the cause and possible solutions of the issue.
36+
37+
## Command line support
38+
39+
You can also use the analysis tool from the command line, as shown in the following example:
40+
41+
```cmd
42+
C:\>cl /analyze Sample.cpp
43+
```
44+
45+
**Visual Studio 2017 version 15.7 and later** You can run the tool from the command line with any build system including CMake.
46+
47+
## #pragma support
48+
49+
You can use the `#pragma` directive to treat warnings as errors; enable or disable warnings, and suppress warnings for individual lines of code. For more information, see [How to: Set Code Analysis Properties for C/C++ Projects](how-to-set-code-analysis-properties-for-c-cpp-projects.md).
50+
51+
## Annotation support
52+
53+
Annotations improve the accuracy of the code analysis. Annotations provide additional information about pre- and post- conditions on function parameters and return types. For more information, see [How to: Specify Additional Code Information by Using __analysis_assume](../code-quality/how-to-specify-additional-code-information-by-using-analysis-assume.md)
3954

4055
## Run analysis tool as part of check-in policy
41-
You might want to require that all source code check-ins satisfy certain policies. In particular, you want to make sure that analysis was run as a step of the most recent local build. For more information about enabling a code analysis check-in policy, see [Creating and Using Code Analysis Check-In Policies](../code-quality/creating-and-using-code-analysis-check-in-policies.md)
4256

43-
## Team Build Integration
44-
You can use the integrated features of the build system to run code analysis tool as a step of the [!INCLUDE[esprtfs](../code-quality/includes/esprtfs_md.md)] build process. For more information, see [Build and release](/vsts/build-release/index).
57+
You might want to require that all source code check-ins satisfy certain policies. In particular, you want to make sure that analysis was run as a step of the most recent local build. For more information about enabling a code analysis check-in policy, see [Creating and Using Code Analysis Check-In Policies](../code-quality/creating-and-using-code-analysis-check-in-policies.md)
4558

46-
## Command-line support
47-
In addition to the full integration within the development environment, developers can also use the analysis tool from the command line, as shown in the following example:
59+
## Team Build integration
4860

49-
`C:\>cl /analyze Sample.cpp`
61+
You can use the integrated features of the build system to run code analysis tool as a step of the [!INCLUDE[esprtfs](../code-quality/includes/esprtfs_md.md)] build process. For more information, see [Build and release](/vsts/build-release/index).
5062

5163
## See also
5264

53-
[Analyzing Driver Quality by Using Code Analysis Tools](/windows-hardware/drivers/develop/analyzing-driver-quality-by-using-code-analysis-tools)
54-
[Code Analysis for Drivers Warnings](/windows-hardware/drivers/devtest/prefast-for-drivers-warnings)
65+
- [Quickstart: Code analysis for C/C++](quick-start-code-analysis-for-c-cpp.md)
66+
- [Walkthrough: Analyze C/C++ Code for Defects](walkthrough-analyzing-c-cpp-code-for-defects.md)
67+
- [Code Analysis for C/C++ Warnings](code-analysis-for-c-cpp-warnings.md)
68+
- [Use the C++ Core Guidelines checkers](using-the-cpp-core-guidelines-checkers.md)
69+
- [C++ Core Guidelines Checker Reference](code-analysis-for-cpp-corecheck.md)
70+
- [Use Rule Sets to Specify the C++ Rules to Run](using-rule-sets-to-specify-the-cpp-rules-to-run.md)
71+
- [Analyze Driver Quality by Using Code Analysis Tools](/windows-hardware/drivers/develop/analyzing-driver-quality-by-using-code-analysis-tools)
72+
- [Code Analysis for Drivers Warnings](/windows-hardware/drivers/devtest/prefast-for-drivers-warnings)

docs/code-quality/how-to-create-or-update-standard-code-analysis-check-in-policies.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Code analysis check-in policies are set in the team project settings and apply t
2525

2626
- For managed code, you set the check-in policy by specifying a *rule set* that contains a subset of the code analysis rules.
2727

28-
- For C/C++ code, the check-in policy requires that all code analysis rules are run. You can add pre-processor directives to disable specific rules for the individual code projects in your team project.
28+
- For C/C++ code, in Visual Studio 2017 version 15.6 and earlier, the check-in policy requires that all code analysis rules are run. You can add pre-processor directives to disable specific rules for the individual code projects in your team project. In 15.7 and later, you can use **/analyze:ruleset** to specify which rules to run. For more information, see [Using Rule Sets to Specify the C++ Rules to Run](using-rule-sets-to-specify-the-cpp-rules-to-run.md).
2929

3030
After you specify a check-in policy for managed code, team members can synchronize their code analysis settings for code projects to the team project policy settings.
3131

docs/code-quality/how-to-specify-additional-code-information-by-using-analysis-assume.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
---
2-
title: "How to: Specify Additional Code Information by Using __analysis_assume"
2+
title: "How to: Specify Additional Code Information by Using _Analysis_assume"
33
ms.date: 11/04/2016
44
ms.prod: visual-studio-dev15
55
ms.technology: vs-ide-code-analysis
66
ms.topic: "conceptual"
77
f1_keywords:
8-
- "__analysis_assume"
8+
- "_Analysis_assume"
99
helpviewer_keywords:
10-
- "__analysis_assume"
10+
- "_Analysis_assume"
1111
ms.assetid: 51205d97-4084-4cf4-a5ed-3eeaf67deb1b
1212
author: mikeblome
1313
ms.author: mblome
1414
manager: wpickett
1515
ms.workload:
1616
- "multiple"
1717
---
18-
# How to: Specify Additional Code Information by Using __analysis_assume
18+
# How to: Specify Additional Code Information by Using _Analysis_assume
1919
You can provide hints to the code analysis tool for C/C++ code that will help the analysis process and reduce warnings. To provide additional information, use the following function:
2020

21-
`__analysis_assume(` `expr` `)`
21+
`_Analysis_assume(` `expr` `)`
2222

2323
`expr` - any expression that is assumed to evaluate to true.
2424

2525
The code analysis tool assumes that the condition represented by the expression is true at the point where the function appears and remains true until expression is altered, for example, by assignment to a variable.
2626

2727
> [!NOTE]
28-
> `__analysis_assume` does not impact code optimization. Outside the code analysis tool, `__analysis_assume` is defined as a no-op.
28+
> `_Analysis_assume` does not impact code optimization. Outside the code analysis tool, `_Analysis_assume` is defined as a no-op.
2929
3030
## Example
31-
The following code uses `__analysis_assume` to correct the code analysis warning [C6388](../code-quality/c6388.md):
31+
The following code uses `_Analysis_assume` to correct the code analysis warning [C6388](../code-quality/c6388.md):
3232

3333
```
3434
#include<windows.h>
@@ -46,7 +46,7 @@ void test( )
4646
{
4747
char *pc = (char*)malloc(5);
4848
FreeAndNull(pc);
49-
__analysis_assume(pc == NULL);
49+
_Analysis_assume(pc == NULL);
5050
f(pc);
5151
}
5252
```

0 commit comments

Comments
 (0)