Skip to content

Commit

Permalink
Merge branch 'main' into ca1707
Browse files Browse the repository at this point in the history
  • Loading branch information
Youssef1313 authored Mar 5, 2021
2 parents 7b559cd + 9e5f533 commit e7c3d0e
Show file tree
Hide file tree
Showing 793 changed files with 143,753 additions and 13,779 deletions.
8 changes: 0 additions & 8 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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 @@ -270,10 +266,6 @@ dotnet_diagnostic.CA1711.severity = suggestion
# CA1309: Use ordinal string comparison
dotnet_diagnostic.CA1309.severity = suggestion

# CA1725: Parameter names should match base declaration
# TODO: Enable this rule as warning and fix violations.
dotnet_diagnostic.CA1725.severity = suggestion

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

Expand Down
7 changes: 6 additions & 1 deletion .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,16 @@ assignees: ''

**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.NetAnalyzers](https://www.nuget.org/packages/Microsoft.CodeAnalysis.NetAnalyzers)

**Version**: 5.0.1 (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.
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
13 changes: 7 additions & 6 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
<!--
Make sure to run `msbuild /t:pack /v:m` in the repository root when
you have any of the following changes that affect auto-generated files. Otherwise, the CI build will fail.
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)
(Consider merging master into your branch before you run msbuild pack to reduce having merge conflicts)
If you're adding a new rule, Make sure to read the guidlines in: https://github.com/dotnet/roslyn-analyzers/blob/master/GuidelinesForNewRules.md.
Also, see https://docs.microsoft.com/contribute/dotnet/dotnet-contribute-code-analysis#contribute-docs-for-caxxxx-rules for documentation guidelines.
Then, make sure to run `msbuild /t:pack /v:m` in the repository root; otherwise, the CI build will fail.
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.
-->
17 changes: 17 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"default": true,
"MD013": false,
"MD026": false,
"MD041": false,
"MD046": {
"style": "fenced"
},
"proper-names": {
"code_blocks": false,
"names": [
"ASP.NET",
"PowerShell",
"C#"
]
}
}
2 changes: 1 addition & 1 deletion GuidelinesForNewRules.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
You can refer to the [official documentation](https://docs.microsoft.com/visualstudio/code-quality/code-analysis-for-managed-code-warnings) for all released CA rules by rule category.

4. Documentation requirements:
1. **New CA rule must be documented**: Each rule ID `CAxxxx` is automatically assigned the help link `https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/caxxxx`. The documentation for this page is populated from `caxxxx.md` file at [dotnet/docs quality-rules folder](https://github.com/dotnet/docs/tree/master/docs/fundamentals/code-analysis/quality-rules). For example, `CA1000` is documented at [ca1000.md](https://github.com/dotnet/docs/tree/master/docs/fundamentals/code-analysis/quality-rules/ca1000.md) file. Documenting a new rule is primarily ensuring a PR is sent to `dotnet/docs` repo to add `caxxxx.md` file for the new rule. Detailed steps are given below.
1. **New CA rule must be documented**: Each rule ID `CAxxxx` is automatically assigned the help link `https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/caxxxx`. The documentation for this page is populated from `caxxxx.md` file at [dotnet/docs quality-rules folder](https://github.com/dotnet/docs/tree/main/docs/fundamentals/code-analysis/quality-rules). For example, `CA1000` is documented at [ca1000.md](https://github.com/dotnet/docs/tree/main/docs/fundamentals/code-analysis/quality-rules/ca1000.md) file. Documenting a new rule is primarily ensuring a PR is sent to `dotnet/docs` repo to add `caxxxx.md` file for the new rule. Detailed steps are given below.
2. **Documentation PR must be submitted within ONE WEEK of the rule implementation being merged**. Note that we will communicate this requirement on each PR contributing a new CA rule. We reserve the right to revert the rule implementation PR if this documentation requirement is not met.

## Guidelines for creating documentation PR
Expand Down
2 changes: 1 addition & 1 deletion NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<add key="dotnet5" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json" />
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />
<add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="dotnet-public" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" />
</packageSources>
<disabledPackageSources>
<clear />
Expand Down
13 changes: 6 additions & 7 deletions PostReleaseActivities.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,17 @@ Please follow the below steps after publishing analyzer NuGet packages from this
1. Checkout a new branch from latest sources of release branch.
2. Update `VERSIONING.md`: Add a new row in the released version table.
3. Update `.github\ISSUE_TEMPLATE\bug-report.md`: Update the package version in the example section to the latest released package version.
4. Update the latest recommended analyzer package at `https://github.com/dotnet/roslyn-analyzers#recommended-version-of-analyzer-packages`
5. Update `eng\Versions.props`:
4. Update `eng\Versions.props`:
1. Bump up the `VersionPrefix`. If the new version prefix is greater then or equals the current `AnalyzerUtilitiesVersionPrefix`, then update `AnalyzerUtilitiesVersionPrefix` to `$(VersionPrefix)`.
2. Reset `PreReleaseVersionLabel` to `beta1`.
3. Update `DogfoodAnalyzersVersion` to the latest released package version.
6. Build the repo by invoking `eng\common\CIBuild.cmd` and fix/suppress any new CA diagnostics, as appropriate. This should also update the analyzer documentation files in the repo to use the new version prefix.
7. Move all the entries from `AnalyzerReleases.Unshipped.md` to `AnalyzerReleases.Shipped.md` for various analyzer NuGet package projects under a new "Release" section in the shipped file.
8. Create and submit a PR with the above changes.
3. Update `DogfoodNetAnalyzersVersion` and/or `DogfoodAnalyzersVersion` to the latest released package version.
5. Build the repo by invoking `eng\common\CIBuild.cmd` and fix/suppress any new CA diagnostics, as appropriate. This should also update the analyzer documentation files in the repo to use the new version prefix.
6. Move all the entries from `AnalyzerReleases.Unshipped.md` to `AnalyzerReleases.Shipped.md` for various analyzer NuGet package projects under a new "Release" section in the shipped file.
7. Create and submit a PR with the above changes.

## Steps to generate Release Notes

1. Checkout the sources for the release branch locally. This would normally be the master branch.
1. Checkout the sources for the release branch locally. This would normally be the main branch.
2. Build.
3. Ensure that nuget.exe is on path.
4. Generate notes: Switch to the output directory, say `artifacts\bin\ReleaseNotesUtil\Debug\netcoreapp3.1` and execute `GenDiffNotes.cmd` to generate release notes. Example command line for v2.9.4 to v2.9.5: `GenDiffNotes.cmd C:\scratch nuget.org 2.9.4 2.9.5`.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Roslyn Analyzers

| |Windows Debug|Windows Release|
|:--------:|:-----------:|:-------------:|
|**master**| [![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/roslyn-analyzers/roslyn-analyzers-CI?branchName=master&jobName=Windows&configuration=Windows%20Debug&label=build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=457&branchName=master) [![codecov](https://codecov.io/gh/dotnet/roslyn-analyzers/branch/master/graph/badge.svg)](https://codecov.io/gh/dotnet/roslyn-analyzers) | [![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/roslyn-analyzers/roslyn-analyzers-CI?branchName=master&jobName=Windows&configuration=Windows%20Release&label=build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=457&branchName=master) |
| |Windows Debug|Windows Release|Ubuntu Debug|Ubuntu Release|
|:--------:|:-----------:|:-------------:|:----------:|:------------:|
|**main**| [![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/roslyn-analyzers/roslyn-analyzers-CI?branchName=main&jobName=Windows&configuration=Windows%20Debug&label=build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=457&branchName=main) [![codecov](https://codecov.io/gh/dotnet/roslyn-analyzers/branch/main/graph/badge.svg)](https://codecov.io/gh/dotnet/roslyn-analyzers) | [![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/roslyn-analyzers/roslyn-analyzers-CI?branchName=main&jobName=Windows&configuration=Windows%20Release&label=build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=457&branchName=main) | [![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/roslyn-analyzers/roslyn-analyzers-CI?branchName=main&jobName=Ubuntu&configuration=Ubuntu%20Debug&label=build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=457&branchName=main) | [![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/roslyn-analyzers/roslyn-analyzers-CI?branchName=main&jobName=Ubuntu&configuration=Ubuntu%20Release&label=build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=457&branchName=main) |

## What is Roslyn?

Expand Down Expand Up @@ -94,7 +94,7 @@ This package contains rules for correct usage of APIs that are present only in _

*Latest stable version:* [![NuGet](https://img.shields.io/nuget/v/Microsoft.CodeAnalysis.Analyzers.svg)](https://www.nuget.org/packages/Microsoft.CodeAnalysis.Analyzers)

*Latest pre-release version:* [here](https://dev.azure.com/dnceng/public/_packaging?_a=package&feed=dotnet5&package=Microsoft.CodeAnalysis.Analyzers&protocolType=NuGet)
*Latest pre-release version:* [here](https://dev.azure.com/dnceng/public/_packaging?_a=package&feed=dotnet6&package=Microsoft.CodeAnalysis.Analyzers&protocolType=NuGet)

This package contains rules for correct usage of APIs from the [Microsoft.CodeAnalysis](https://www.nuget.org/packages/Microsoft.CodeAnalysis) NuGet package, i.e. .NET Compiler Platform ("Roslyn") APIs. These are primarily aimed towards helping authors of diagnostic analyzers and code fix providers to invoke the Microsoft.CodeAnalysis APIs in a recommended manner. [More info about rules in this package](src/Microsoft.CodeAnalysis.Analyzers/Microsoft.CodeAnalysis.Analyzers.md)

Expand Down Expand Up @@ -130,7 +130,7 @@ Created by summer 2015 interns [Zoë Petard](https://github.com/zoepetard), [Jes

The MetaCompilation Analyzer is an analyzer that functions as a tutorial to teach users how to write an analyzer. It uses diagnostics and code fixes to guide the user through the various steps required to create a simple analyzer. It is designed for novice analyzer developers who have some previous programming experience.

For instructions on using this tutorial, see [Instructions](https://github.com/dotnet/roslyn-analyzers/blob/master/src/MetaCompilation.Analyzers/Core/ReadMe.md#instructions).
For instructions on using this tutorial, see [Instructions](https://github.com/dotnet/roslyn-analyzers/blob/main/src/MetaCompilation.Analyzers/Core/ReadMe.md#instructions).

## Getting Started

Expand Down
1 change: 1 addition & 0 deletions VERSIONING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Sr. No. | Release |
--------|-----------------|
1 | [5.0.0](https://github.com/dotnet/roslyn-analyzers/releases/tag/5.0.0) |
2 | [5.0.1](https://github.com/dotnet/roslyn-analyzers/releases/tag/5.0.1) |
3 | [5.0.3](https://github.com/dotnet/roslyn-analyzers/releases/tag/5.0.3) |

### Other analyzers

Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines-microbuild.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Branches that trigger a build on commit
trigger:
- master
- main
- release/*
- 2.9.x

Expand Down
19 changes: 14 additions & 5 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Branches that trigger a build on commit
trigger:
- master
- main
- release/*
- 2.9.x

# Branch(es) that trigger(s) build(s) on PR
pr:
- master
- main
- release/*
- 2.9.x

Expand Down Expand Up @@ -102,12 +102,21 @@ jobs:
testRunner: XUnit
testResultsFiles: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_configuration)/*.xml'
mergeTestResults: true
testRunTitle: 'Windows $(_configuration)'
testRunTitle: 'Ubuntu $(_configuration)'
condition: always()
- task: PublishBuildArtifacts@1
displayName: Publish Logs
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/log/$(_configuration)'
ArtifactName: 'Windows $(_configuration)'
ArtifactName: 'Ubuntu $(_configuration)'
continueOnError: true
condition: always()
condition: always()

- job: Markdownlint
pool:
vmImage: ubuntu-18.04
steps:
- script: sudo npm install -g markdownlint-cli
displayName: Install markdownlint-cli
- script: markdownlint '**/*.md' -i '**/AnalyzerReleases.*.md' -i 'docs/Analyzer reference page template.md' -i 'eng/common/**/*.md'
displayName: Run markdownlint
Loading

0 comments on commit e7c3d0e

Please sign in to comment.