Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: dotnet/roslyn-analyzers
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 6.0.0
Choose a base ref
...
head repository: dotnet/roslyn-analyzers
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7.0.0
Choose a head ref

Commits on Dec 31, 2020

  1. Copy the full SHA
    377c776 View commit details

Commits on Jan 1, 2021

  1. Apply review comments

    Evangelink committed Jan 1, 2021
    Copy the full SHA
    8823b97 View commit details

Commits on Apr 23, 2021

  1. Copy the full SHA
    00bd8a9 View commit details
  2. Copy the full SHA
    bbf1d31 View commit details
  3. Copy the full SHA
    0187532 View commit details

Commits on Jun 28, 2021

  1. Add test for ??= operator

    Evangelink committed Jun 28, 2021
    Copy the full SHA
    b581a23 View commit details
  2. Copy the full SHA
    467a0ef View commit details

Commits on Jul 9, 2021

  1. Copy the full SHA
    fb16660 View commit details

Commits on Jul 13, 2021

  1. Allow multiple input files for SymbolIsBannedAnalyzer

    Accept BannedSymbols.txt and BannedSymbols.*.txt
    ltrzesniewski committed Jul 13, 2021
    Copy the full SHA
    bbce803 View commit details
  2. Copy the full SHA
    813f68e View commit details

Commits on Jul 17, 2021

  1. General cleanup

    Youssef1313 committed Jul 17, 2021
    Copy the full SHA
    70ce0d4 View commit details
  2. Copy the full SHA
    f7ec258 View commit details
  3. Restore wellknown type

    Youssef1313 committed Jul 17, 2021
    Copy the full SHA
    b07058a View commit details
  4. Fix

    Youssef1313 committed Jul 17, 2021
    Copy the full SHA
    153c37e View commit details

Commits on Jul 18, 2021

  1. Fix

    Youssef1313 committed Jul 18, 2021
    Copy the full SHA
    6569181 View commit details

Commits on Jul 19, 2021

  1. Address feedback

    Youssef1313 authored Jul 19, 2021
    Copy the full SHA
    a19587d View commit details
  2. Update src/Utilities/Compiler/Extensions/ISymbolExtensions.cs

    Co-authored-by: Amaury Levé <amaury.leve@gmail.com>
    Youssef1313 and Evangelink authored Jul 19, 2021
    Copy the full SHA
    fd67725 View commit details
  3. Copy the full SHA
    bfc43de View commit details
  4. Copy the full SHA
    1d09f36 View commit details

Commits on Jul 20, 2021

  1. readme sub badges

    ZacharyPatten committed Jul 20, 2021
    Copy the full SHA
    988b956 View commit details
  2. radme sub badges

    ZacharyPatten committed Jul 20, 2021
    Copy the full SHA
    2ec5142 View commit details

Commits on Jul 21, 2021

  1. Merge branch 'main' into CS8618

    # Conflicts:
    #	src/Utilities/Compiler/SmallDictionary.cs
    Evangelink committed Jul 21, 2021
    Copy the full SHA
    0639235 View commit details
  2. Merge if with outer if

    Evangelink committed Jul 21, 2021
    Copy the full SHA
    7e5dd1e View commit details

Commits on Jul 22, 2021

  1. Simplify linq expressions

    Evangelink committed Jul 22, 2021
    Copy the full SHA
    8d562fe View commit details

Commits on Jul 23, 2021

  1. Copy the full SHA
    61b0ca0 View commit details

Commits on Jul 24, 2021

  1. Copy the full SHA
    da0df80 View commit details

Commits on Jul 26, 2021

  1. Make known tags readonly

    Evangelink committed Jul 26, 2021
    Copy the full SHA
    4cfb92a View commit details

Commits on Jul 27, 2021

  1. First meaningful commit

    Cosifne committed Jul 27, 2021
    Copy the full SHA
    805782a View commit details

Commits on Jul 28, 2021

  1. Copy the full SHA
    9a16d6a View commit details
  2. Copy the full SHA
    b1808c9 View commit details
  3. Copy the full SHA
    875bcda View commit details
  4. Fix tests

    Evangelink committed Jul 28, 2021
    Copy the full SHA
    22c8bf7 View commit details
  5. Copy the full SHA
    a9bd453 View commit details

Commits on Jul 30, 2021

  1. Copy the full SHA
    ef07524 View commit details
  2. Copy the full SHA
    e62cd0c View commit details
  3. Update src/NetAnalyzers/UnitTests/Microsoft.CodeQuality.Analyzers/Api…

    …DesignGuidelines/IdentifiersShouldHaveCorrectSuffixTests.cs
    Evangelink committed Jul 30, 2021
    Copy the full SHA
    aa03e29 View commit details
  4. Copy the full SHA
    fe4a2ef View commit details
  5. Reduce nesting

    Evangelink committed Jul 30, 2021
    Copy the full SHA
    3886575 View commit details
  6. Copy the full SHA
    a258a40 View commit details
  7. Copy the full SHA
    b69855e View commit details
  8. Copy the full SHA
    6a0371e View commit details
  9. Cleamup

    Evangelink committed Jul 30, 2021
    Copy the full SHA
    05dd4b2 View commit details

Commits on Aug 6, 2021

  1. Copy the full SHA
    99a2a63 View commit details
  2. Copy the full SHA
    74ed781 View commit details
  3. Set analyzers global_level to -99/-100.

    This allows MSBuild SDKs that extend `Microsoft.NET.Sdk` to inject config files between Roslyn's config files and arbitrary files provided by the user or NuGet packages.
    alexrp authored Aug 6, 2021
    Copy the full SHA
    26de316 View commit details

Commits on Aug 7, 2021

  1. Copy the full SHA
    351a057 View commit details
  2. Copy the full SHA
    996039e View commit details

Commits on Aug 9, 2021

  1. Update src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/ApiDesig…

    …nGuidelines/MarkAssembliesWithComVisible.cs
    
    Co-authored-by: Sam Harwell <sam@tunnelvisionlabs.com>
    flash2048 and sharwell authored Aug 9, 2021
    Copy the full SHA
    3294775 View commit details

Commits on Aug 15, 2021

  1. Copy the full SHA
    4d5aa28 View commit details
  2. Copy the full SHA
    04d899e View commit details
Showing 944 changed files with 48,961 additions and 23,873 deletions.
10 changes: 10 additions & 0 deletions .config/tsaoptions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"instanceUrl": "https://devdiv.visualstudio.com/",
"template": "TFSDEVDIV",
"projectName": "DEVDIV",
"areaPath": "DevDiv\\NET Developer Experience\\Productivity",
"iterationPath": "DevDiv",
"notificationAliases": [ "mlinfraswat@microsoft.com" ],
"repositoryName":"roslyn-analyzers",
"codebaseName": "roslyn-analyzers"
}
3 changes: 3 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -12,6 +12,9 @@ If your Pull Request is doing one of the following:
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 RoslynAnalyzers.sln -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.
-->
48 changes: 48 additions & 0 deletions .github/workflows/community-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Label community PRs
on:
pull_request_target:
types: [opened]
permissions:
issues: write
pull-requests: write
jobs:
add_community_label:
runs-on: ubuntu-latest
if: ${{ github.repository == 'dotnet/roslyn-analyzers' && github.event.pull_request.user.login != 'dotnet-bot' && github.event.pull_request.user.login != 'dotnet-maestro[bot]' }}
steps:
- name: Get data
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ORGANIZATION: dotnet
REPOSITORY: roslyn-analyzers
LABEL_NAME: Community
PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
run: |
gh api graphql -f query='
query($org: String!, $repo: String!, $pull: Int!, $label: String!) {
repository(name: $repo, owner: $org) {
label(name: $label) {
id
}
pullRequest(number: $pull) {
authorAssociation
}
}
}' -f org=$ORGANIZATION -f repo=$REPOSITORY -F pull=$PULL_REQUEST_NUMBER -f label="$LABEL_NAME" > data.json
cat data.json
echo 'LABEL_ID='$(jq -r '.data.repository.label.id' data.json) >> $GITHUB_ENV
echo 'AUTHOR_ASSOCIATION='$(jq -r '.data.repository.pullRequest.authorAssociation' data.json) >> $GITHUB_ENV
- name: Assign label
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PULL_REQUEST_ID: ${{ github.event.pull_request.node_id }}
if: ${{ env.LABEL_ID != '' && env.LABEL_ID != 'null' && env.AUTHOR_ASSOCIATION != 'MEMBER' }}
run: |
gh api graphql -f query='
mutation($pull: ID!, $label: ID!) {
addLabelsToLabelable(input: {labelableId: $pull, labelIds: [$label]}) {
clientMutationId
}
}' -f pull=$PULL_REQUEST_ID -f label=$LABEL_ID
28 changes: 28 additions & 0 deletions .github/workflows/enable-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Enable auto merge
on:
pull_request_target:
types: [opened, ready_for_review]
permissions:
contents: write
jobs:
add_milestone:
runs-on: ubuntu-latest
if: ${{ github.repository == 'dotnet/roslyn-analyzers' && github.event.pull_request.user.login == 'dotnet-bot' && startsWith(github.event.pull_request.title, 'Localized file check-in') }}
steps:
- name: Enable pull request auto-merge
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PULL_REQUEST_ID: ${{ github.event.pull_request.node_id }}
run: |
gh api graphql -f query='
mutation($pull: ID!) {
enablePullRequestAutoMerge(input: {pullRequestId: $pull}) {
pullRequest {
id
number
autoMergeRequest {
mergeMethod
}
}
}
}' -f pull=$PULL_REQUEST_ID
53 changes: 53 additions & 0 deletions .github/workflows/milestone-tracking.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Milestone tracking
on:
pull_request_target:
types: [closed]
permissions:
issues: write
pull-requests: write
jobs:
add_milestone:
runs-on: ubuntu-latest
if: ${{ github.repository == 'dotnet/roslyn-analyzers' && github.event.pull_request.merged_at != null && github.event.pull_request.milestone == null && github.event.pull_request.base.ref == 'main' }}
steps:
- name: Get milestone data
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ORGANIZATION: dotnet
REPOSITORY: roslyn-analyzers
MILESTONE_NAME: vNext
run: |
gh api graphql -f query='
query($org: String!, $repo: String!, $milestone: String!) {
repository(name: $repo, owner: $org) {
milestones(query: $milestone, first: 2) {
nodes {
id
title
}
}
}
}' -f org=$ORGANIZATION -f repo=$REPOSITORY -f milestone="$MILESTONE_NAME" > milestone_data.json
echo 'MILESTONE_ID='$(jq -r 'if (((.data.repository.milestones.nodes | length) == 1) and .data.repository.milestones.nodes[0].title == $MILESTONE_NAME) then .data.repository.milestones.nodes[0].id else "" end' --arg MILESTONE_NAME "$MILESTONE_NAME" milestone_data.json) >> $GITHUB_ENV
- name: Assign milestone
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PULL_REQUEST_ID: ${{ github.event.pull_request.node_id }}
if: ${{ env.MILESTONE_ID != '' }}
run: |
gh api graphql -f query='
mutation($pull: ID!, $milestone: ID!) {
updatePullRequest(input: {pullRequestId: $pull, milestoneId: $milestone}) {
pullRequest {
id
number
milestone {
id
number
title
}
}
}
}' -f pull=$PULL_REQUEST_ID -f milestone=$MILESTONE_ID
52 changes: 52 additions & 0 deletions .github/workflows/review-sdk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Review automatic pull requests
on:
pull_request_target:
types: [opened, ready_for_review]
permissions:
issues: write
pull-requests: write
jobs:
auto_review:
runs-on: ubuntu-latest
if: ${{ github.repository == 'dotnet/roslyn-analyzers' && (github.event.pull_request.user.login == 'dotnet-bot' || github.event.pull_request.user.login == 'dotnet-maestro[bot]') }}
steps:
- name: Create review
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PULL_REQUEST_ID: ${{ github.event.pull_request.node_id }}
run: |
gh api graphql -f query='
mutation($pull: ID!) {
addPullRequestReview(input: {pullRequestId: $pull}) {
pullRequestReview {
id
}
}
}' -f pull=$PULL_REQUEST_ID > data.json
cat data.json
echo 'REVIEW_ID='$(jq -r '.data.addPullRequestReview.pullRequestReview.id' data.json) >> $GITHUB_ENV
- name: Submit approval
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ env.REVIEW_ID != '' && env.REVIEW_ID != 'null' && !contains(github.event.pull_request.body, 'Updates sdk.version') }}
run: |
gh api graphql -f query='
mutation($review: ID!) {
submitPullRequestReview(input: {pullRequestReviewId: $review, event: APPROVE, body: "Auto-approve"}) {
clientMutationId
}
}' -f review=$REVIEW_ID
- name: Submit change request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ env.REVIEW_ID != '' && env.REVIEW_ID != 'null' && contains(github.event.pull_request.body, 'Updates sdk.version') }}
run: |
gh api graphql -f query='
mutation($review: ID!) {
submitPullRequestReview(input: {pullRequestReviewId: $review, event: REQUEST_CHANGES, body: "This PR changes the .NET SDK version. Review required from @dotnet/roslyn-infrastructure before merging."}) {
clientMutationId
}
}' -f review=$REVIEW_ID
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@
*.user
.vs/
.vscode/
.idea/

# Build results
artifacts/
3 changes: 3 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -3,6 +3,9 @@
"MD013": false,
"MD024": false,
"MD026": false,
"MD033": {
"allowed_elements": [ "sub" ]
},
"MD041": false,
"MD046": {
"style": "fenced"
5 changes: 4 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@
</PropertyGroup>

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

<PropertyGroup>
<!-- Do not ship packages by default -->
@@ -20,7 +21,9 @@
<PropertyGroup>
<LangVersion Condition="'$(Language)' == 'C#'">preview</LangVersion>
<LangVersion Condition="'$(Language)' == 'VB'">16</LangVersion>


<NoWarn>$(NoWarn);NU1701</NoWarn>

<!-- 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 -->
8 changes: 4 additions & 4 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -4,12 +4,12 @@

<!-- Add License and Third Party Notices files into each VSIX. -->
<ItemGroup>
<Content Include="$(MSBuildThisFileDirectory)\assets\EULA.rtf">
<Link>EULA.rtf</Link>
<Content Include="$(MSBuildThisFileDirectory)\assets\EULA.txt">
<Link>EULA.txt</Link>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="$(MSBuildThisFileDirectory)\assets\ThirdPartyNotices.rtf">
<Link>ThirdPartyNotices.rtf</Link>
<Content Include="$(MSBuildThisFileDirectory)\assets\ThirdPartyNotices.txt">
<Link>ThirdPartyNotices.txt</Link>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
</ItemGroup>
6 changes: 3 additions & 3 deletions GuidelinesForNewRules.md
Original file line number Diff line number Diff line change
@@ -16,16 +16,16 @@
1. Choose `CA1830` as the rule ID for your rule.
2. Update the range for `Performance` in [DiagnosticCategoryAndIdRanges.txt](.//src//Utilities//Compiler//DiagnosticCategoryAndIdRanges.txt) to `CA1800-CA1830`

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.
You can refer to the [official documentation](https://learn.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/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.
1. **New CA rule must be documented**: Each rule ID `CAxxxx` is automatically assigned the help link `https://learn.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

1. Documentation PR must be submitted to the [dotnet/docs](https://github.com/dotnet/docs) repo:

Please review [Contribute docs for .NET code analysis rules to the .NET docs repository](https://docs.microsoft.com/contribute/dotnet/dotnet-contribute-code-analysis) for guidelines.
Please review [Contribute docs for .NET code analysis rules to the .NET docs repository](https://learn.microsoft.com/contribute/dotnet/dotnet-contribute-code-analysis) for guidelines.

If for some exceptional reason you are unable to submit a PR, please [file a documentation issue](https://github.com/dotnet/docs/issues) to add documentation for the rule in future. Please include all relevant information in the issue to allow the documentation experts to easily author the documentation.
2 changes: 2 additions & 0 deletions NuGet.config
Original file line number Diff line number Diff line change
@@ -4,9 +4,11 @@
<packageSources>
<clear />
<add key="dotnet5" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json" />
<add key="dotnet7" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/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="dotnet-public" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" />
<add key="vssdk" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/vssdk/nuget/v3/index.json" />
<!-- Used for Rich Navigation indexing task -->
<add key="richnav" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/vs-buildservices/nuget/v3/index.json" />
</packageSources>
7 changes: 6 additions & 1 deletion PostReleaseActivities.md
Original file line number Diff line number Diff line change
@@ -25,4 +25,9 @@ Please follow the below steps after publishing analyzer NuGet packages from this
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`.
4. Generate notes: Switch to the output directory, say `artifacts\bin\ReleaseNotesUtil\Debug\net7.0` 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`.

## Followup items

1. For `Microsoft.CodeAnalysis.Analyzers` package, update [`MicrosoftCodeAnalysisAnalyzersVersion`](https://github.com/dotnet/roslyn/blob/95809b0b922439465a213922ef7eb81e9b5a223f/eng/Versions.props#L82) in dotnet/roslyn to reference the new package version.
2. For `Roslyn.Diagnostics.Analyzers` package, update [`RoslynDiagnosticsNugetPackageVersion`](https://github.com/dotnet/roslyn/blob/95809b0b922439465a213922ef7eb81e9b5a223f/eng/Versions.props#L30) in dotnet/roslyn to reference the new package version.
Loading