Skip to content

Commit

Permalink
Merge branch 'main' into merges/release/5.0.3xx-to-main
Browse files Browse the repository at this point in the history
  • Loading branch information
jmarolf authored Sep 16, 2021
2 parents 91285e2 + c6a88e4 commit b94f168
Show file tree
Hide file tree
Showing 2,060 changed files with 181,500 additions and 51,022 deletions.
3 changes: 3 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"postCreateCommand": "devinit init"
}
7 changes: 7 additions & 0 deletions .devcontainer/devinit.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"run": [
{
"tool": "require-dotnetcoresdk"
}
]
}
50 changes: 37 additions & 13 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ indent_style = space
# https://github.com/dotnet/roslyn-analyzers/issues/3389
dotnet_diagnostic.RS1024.severity = none

# IDE0078: Use pattern matching
# https://github.com/dotnet/roslyn/issues/51691
# https://github.com/dotnet/roslyn/issues/51693
dotnet_diagnostic.IDE0078.severity = silent

# Code files
[*.{cs,csx,vb,vbx}]
indent_size = 4
Expand Down Expand Up @@ -75,11 +80,6 @@ dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
dotnet_style_prefer_simplified_interpolation = true:suggestion

# Dispose rules (CA2000 and CA2213) ported to IDE analyzers. We already execute the CA rules on the repo, so disable the IDE ones.
dotnet_diagnostic.IDE0067.severity = none
dotnet_diagnostic.IDE0068.severity = none
dotnet_diagnostic.IDE0069.severity = none

### CSharp code style settings ###
[*.cs]

Expand All @@ -97,10 +97,6 @@ csharp_style_expression_bodied_operators = false:none
csharp_style_expression_bodied_local_functions = false:none
csharp_style_expression_bodied_lambdas = true:none

# Prefer property-like constructs to have an expression-body
csharp_style_expression_bodied_properties = true:none
csharp_style_expression_bodied_indexers = true:none
csharp_style_expression_bodied_accessors = true:none

# Pattern matching preferences
csharp_style_pattern_matching_over_as_with_null_check = true:warning
Expand Down Expand Up @@ -185,13 +181,17 @@ visual_basic_style_unused_value_assignment_preference = unused_local_variable:wa
### Configuration for IDE code style by diagnostic IDs ###
[*.{cs,vb}]

# Default severity for all IDE code style rules with category 'Style'
dotnet_analyzer_diagnostic.category-Style.severity = warning

# Default severity for all IDE code quality rules with category 'CodeQuality'
dotnet_analyzer_diagnostic.category-CodeQuality.severity = warning

# IDE0066: Convert switch statement to expression
dotnet_diagnostic.IDE0066.severity = suggestion

# IDE0073: File header
file_header_template = Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
file_header_template = Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information.

# IDE0001: Name can be simplified
dotnet_diagnostic.IDE0001.severity = silent
Expand All @@ -202,9 +202,6 @@ dotnet_diagnostic.IDE0002.severity = silent
# IDE0003: Name can be simplified
dotnet_diagnostic.IDE0003.severity = silent

# IDE005_gen: Remove unnecessary usings in generated code
dotnet_diagnostic.IDE0005_gen.severity = silent

# IDE0007: Use 'var' instead of explicit type
dotnet_diagnostic.IDE0007.severity = silent

Expand Down Expand Up @@ -251,8 +248,35 @@ dotnet_code_quality.CA1720.api_surface = public
# CA1715: Identifiers should have correct prefix
dotnet_code_quality.CA1715.exclude_single_letter_type_parameters = true

# CA1002: Do not expose generic lists
dotnet_diagnostic.CA1002.severity = suggestion

# CA1024: Use properties where appropriate
dotnet_diagnostic.CA1024.severity = suggestion

# CA1033: Interface methods should be callable by child types
dotnet_diagnostic.CA1033.severity = suggestion

# CA1307: Specify StringComparison for clarity
dotnet_diagnostic.CA1307.severity = suggestion

# CA1711: Identifiers should not have incorrect suffix
dotnet_diagnostic.CA1711.severity = suggestion

# CA1309: Use ordinal string comparison
dotnet_diagnostic.CA1309.severity = suggestion

### Configuration for PublicAPI analyzers executed on this repo ###
[*.{cs,vb}]

# Analyzers bail-out if the PublicAPI.*.txt file is not found
dotnet_public_api_analyzer.require_api_files = true

### Configuration for vs-threading analyzers executed on this repo ###
[*.{cs,vb}]

# VSTHRD002: Avoid problematic synchronous waits
dotnet_diagnostic.VSTHRD002.severity = none

# VSTHRD011: Use AsyncLazy<T>
dotnet_diagnostic.VSTHRD011.severity = none
20 changes: 15 additions & 5 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Bug report
about: Report a bug, false-positive or false-negative
about: Report a bug, false-positive or false-negative for a CAxxxx rule. For IDExxxx, please open an issue in dotnet/roslyn repository.
title: ''
labels: ''
assignees: ''
Expand All @@ -9,19 +9,29 @@ assignees: ''

### Analyzer

**Diagnostic ID**: [CA2013](https://docs.microsoft.com/visualstudio/code-quality/ca2013): `Do not use ReferenceEquals with value types`
**Diagnostic ID**: [CA2013](https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2013): `Do not use ReferenceEquals with value types`

### Analyzer source

**SDK**: [Built-in CA analyzers in .NET 5 SDK or later](https://docs.microsoft.com/dotnet/fundamentals/productivity/code-analysis)

**Version**: [SDK 5.0.100-preview.8](https://dotnet.microsoft.com/download/dotnet/5.0)
**Version**: [SDK 5.0.100](https://dotnet.microsoft.com/download/dotnet/5.0)

<!--
Note: Updates to NuGet package are more frequent than SDK, which means the NuGet package has fixes that haven't yet made it into the SDK.
Please check whether you can reproduce the bug you encountered in the latest NuGet package.
-->

_OR_

**NuGet Package**: [Microsoft.CodeAnalysis.FxCopAnalyzers](https://www.nuget.org/packages/Microsoft.CodeAnalysis.FxCopAnalyzers)
**NuGet Package**: [Microsoft.CodeAnalysis.NetAnalyzers](https://www.nuget.org/packages/Microsoft.CodeAnalysis.NetAnalyzers)

**Version**: v3.3.0 (Latest)
**Version**: 5.0.3 (Latest)

<!--
NOTE: `Microsoft.CodeAnalysis.FxCopAnalyzers` package has been deprecated in favor of 'Microsoft.CodeAnalysis.NetAnalyzers', that ships with the .NET SDK.
Please refer to https://docs.microsoft.com/visualstudio/code-quality/migrate-from-fxcop-analyzers-to-net-analyzers to migrate to .NET analyzers.
-->

### Describe the bug

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/rule-improvement.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ assignees: ''

### Analyzer

**Diagnostic ID**: [CA1716](https://docs.microsoft.com/visualstudio/code-quality/ca1716)
**Diagnostic ID**: [CA1716](https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1716)

### Describe the improvement

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/suggest-a-new-rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ assignees: ''

---

<!-- Please refer to https://github.com/dotnet/roslyn-analyzers/blob/master/GuidelinesForNewRules.md -->
<!-- Please refer to https://github.com/dotnet/roslyn-analyzers/blob/main/GuidelinesForNewRules.md -->

### Describe the problem you are trying to solve

Expand Down
20 changes: 20 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!--
Make sure you have read the contribution guidelines:
- https://docs.microsoft.com/contribute/dotnet/dotnet-contribute-code-analysis#contribute-docs-for-caxxxx-rules
- https://github.com/dotnet/roslyn-analyzers/blob/main/GuidelinesForNewRules.md
If your Pull Request is doing one of the following:
- Adding a new diagnostic analyzer or a code fix
- Adding or updating resource strings used by analyzers and code fixes
- Updating analyzer package versions in [Versions.props](../eng/Versions.props)
Then, make sure to run `msbuild /t:pack /v:m` in the repository root; otherwise, the CI build will fail.
- This command must be run from a Visual Studio Developer Command Prompt
- Alternatively, `dotnet msbuild /t:Pack /v:m` can be used from a standard terminal window
Note: Consider merging the PR base branch (`2.9.x`, `main`, or `release/*`) into your branch before you run the pack command to reduce merge conflicts.
-->
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ obj/
.dotnet/
.tools/
.packages/
temp/

# Per-user project properties
launchSettings.json
Expand Down
21 changes: 21 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"default": true,
"MD013": false,
"MD024": false,
"MD026": false,
"MD033": {
"allowed_elements": [ "sub" ]
},
"MD041": false,
"MD046": {
"style": "fenced"
},
"proper-names": {
"code_blocks": false,
"names": [
"ASP.NET",
"PowerShell",
"C#"
]
}
}
2 changes: 1 addition & 1 deletion CopyrightHeader.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information.
13 changes: 11 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information. -->
<Project>
<PropertyGroup>
<ImportNetSdkFromRepoToolset>false</ImportNetSdkFromRepoToolset>
Expand All @@ -12,12 +12,21 @@

<Import Project="Sdk.props" Sdk="Microsoft.DotNet.Arcade.Sdk" />

<PropertyGroup>
<!-- Do not ship packages by default -->
<IsShippingPackage>false</IsShippingPackage>
</PropertyGroup>

<PropertyGroup>
<LangVersion Condition="'$(Language)' == 'C#'">preview</LangVersion>
<LangVersion Condition="'$(Language)' == 'VB'">16</LangVersion>


<!-- Do not warn about the version of analyzers being used in this project -->
<_SkipUpgradeNetAnalyzersNuGetWarning>true</_SkipUpgradeNetAnalyzersNuGetWarning>
<!-- TODO: Enable Nullable for test and non-shipping projects -->
<Nullable Condition="'$(Nullable)' == '' and '$(IsTestProject)' != 'true' and '$(NonShipping)' != 'true'">enable</Nullable>

<Features>strict</Features>
</PropertyGroup>

<PropertyGroup>
Expand Down
40 changes: 11 additions & 29 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information. -->
<Project>
<Import Project="Sdk.targets" Sdk="Microsoft.DotNet.Arcade.Sdk" />

Expand All @@ -18,7 +18,7 @@
<PackageReference Include="coverlet.msbuild" Version="$(CoverletVersion)" PrivateAssets="all" />
</ItemGroup>

<PropertyGroup Condition="'$(IsTestProject)' == 'true' or '$(NonShipping)' == 'true' or '$(IsVsixProject)' == 'true' or '$(FxCopAnalyzersProject)' == 'true'">
<PropertyGroup Condition="'$(IsTestProject)' == 'true' or '$(NonShipping)' == 'true' or '$(IsVsixProject)' == 'true'">
<ReleaseTrackingOptOut>true</ReleaseTrackingOptOut>
</PropertyGroup>

Expand Down Expand Up @@ -57,38 +57,20 @@
Properties="TargetFramework=%(_TargetFramework.Identity)" />
</Target>

<Target Name="OuterGenerateCoverageResult" AfterTargets="RunTests" Condition="'$(IsUnitTestProject)' == 'true' AND '$(TargetFramework)' == ''">
<Target Name="OuterGenerateCoverageResult" BeforeTargets="Test" Condition="'$(IsUnitTestProject)' == 'true' AND '$(TargetFramework)' == ''">
<MSBuild
Projects="$(MSBuildProjectFullPath)"
Targets="InnerGenerateCoverageResult"
Properties="TargetFramework=%(_TargetFramework.Identity)" />
</Target>

<Target Name="InnerInstrumentModulesNoBuild" BeforeTargets="RunTests" Condition="'$(IsUnitTestProject)' == 'true' AND '$(TargetFramework)' != ''">
<Coverlet.MSbuild.Tasks.InstrumentationTask
Condition="'$(CollectCoverage)' == 'true'"
Path="$(TargetPath)"
Include="$(Include)"
IncludeDirectory="$(IncludeDirectory)"
Exclude="$(Exclude)"
ExcludeByFile="$(ExcludeByFile)"
ExcludeByAttribute="$(ExcludeByAttribute)"
IncludeTestAssembly="$(IncludeTestAssembly)"
SingleHit="$(SingleHit)"
MergeWith="$(MergeWith)"
UseSourceLink="$(UseSourceLink)" >
<Output TaskParameter="InstrumenterState" PropertyName="InstrumenterState"/>
</Coverlet.MSbuild.Tasks.InstrumentationTask>
</Target>
<Target Name="InnerInstrumentModulesNoBuild"
BeforeTargets="RunTests"
DependsOnTargets="InstrumentModules"
Condition="'$(IsUnitTestProject)' == 'true' AND '$(TargetFramework)' != '' AND '$(CollectCoverage)' == 'true'" />

<Target Name="InnerGenerateCoverageResult" AfterTargets="RunTests" Condition="'$(IsUnitTestProject)' == 'true' AND '$(TargetFramework)' != ''">
<Coverlet.MSbuild.Tasks.CoverageResultTask
Condition="'$(CollectCoverage)' == 'true'"
Output="$(CoverletOutput)"
OutputFormat="$(CoverletOutputFormat)"
Threshold="$(Threshold)"
ThresholdType="$(ThresholdType)"
ThresholdStat="$(ThresholdStat)"
InstrumenterState="$(InstrumenterState)"/>
</Target>
<Target Name="InnerGenerateCoverageResult"
BeforeTargets="Test"
DependsOnTargets="GenerateCoverageResult"
Condition="'$(IsUnitTestProject)' == 'true' AND '$(TargetFramework)' != '' AND '$(CollectCoverage)' == 'true'" />
</Project>
Loading

0 comments on commit b94f168

Please sign in to comment.