Skip to content

Commit 5c2cf19

Browse files
Copilotstephentoub
andcommitted
Add CA1876 analyzer for detecting misuse of AsParallel in foreach loops
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
1 parent eedbd6a commit 5c2cf19

File tree

498 files changed

+1192
-656
lines changed

Some content is hidden

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

498 files changed

+1192
-656
lines changed

src/Microsoft.CodeAnalysis.NetAnalyzers/src/Microsoft.CodeAnalysis.CSharp.NetAnalyzers/Microsoft.CodeQuality.Analyzers/ApiDesignGuidelines/CSharpAvoidEmptyInterfaces.Fixer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information.
22

33
using System.Composition;
4-
using Microsoft.CodeQuality.Analyzers.ApiDesignGuidelines;
54
using Microsoft.CodeAnalysis;
65
using Microsoft.CodeAnalysis.CodeFixes;
6+
using Microsoft.CodeQuality.Analyzers.ApiDesignGuidelines;
77

88
namespace Microsoft.CodeQuality.CSharp.Analyzers.ApiDesignGuidelines
99
{
@@ -14,4 +14,4 @@ namespace Microsoft.CodeQuality.CSharp.Analyzers.ApiDesignGuidelines
1414
public sealed class CSharpAvoidEmptyInterfacesFixer : AvoidEmptyInterfacesFixer
1515
{
1616
}
17-
}
17+
}

src/Microsoft.CodeAnalysis.NetAnalyzers/src/Microsoft.CodeAnalysis.CSharp.NetAnalyzers/Microsoft.CodeQuality.Analyzers/ApiDesignGuidelines/CSharpCollectionsShouldImplementGenericInterface.Fixer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information.
22

33
using System.Composition;
4-
using Microsoft.CodeQuality.Analyzers.ApiDesignGuidelines;
54
using Microsoft.CodeAnalysis;
65
using Microsoft.CodeAnalysis.CodeFixes;
6+
using Microsoft.CodeQuality.Analyzers.ApiDesignGuidelines;
77

88
namespace Microsoft.CodeQuality.CSharp.Analyzers.ApiDesignGuidelines
99
{
@@ -14,4 +14,4 @@ namespace Microsoft.CodeQuality.CSharp.Analyzers.ApiDesignGuidelines
1414
public sealed class CSharpCollectionsShouldImplementGenericInterfaceFixer : CollectionsShouldImplementGenericInterfaceFixer
1515
{
1616
}
17-
}
17+
}

src/Microsoft.CodeAnalysis.NetAnalyzers/src/Microsoft.CodeAnalysis.CSharp.NetAnalyzers/Microsoft.CodeQuality.Analyzers/ApiDesignGuidelines/CSharpDeclareTypesInNamespaces.Fixer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information.
22

33
using System.Composition;
4-
using Microsoft.CodeQuality.Analyzers.ApiDesignGuidelines;
54
using Microsoft.CodeAnalysis;
65
using Microsoft.CodeAnalysis.CodeFixes;
6+
using Microsoft.CodeQuality.Analyzers.ApiDesignGuidelines;
77

88
namespace Microsoft.CodeQuality.CSharp.Analyzers.ApiDesignGuidelines
99
{
@@ -14,4 +14,4 @@ namespace Microsoft.CodeQuality.CSharp.Analyzers.ApiDesignGuidelines
1414
public sealed class CSharpDeclareTypesInNamespacesFixer : DeclareTypesInNamespacesFixer
1515
{
1616
}
17-
}
17+
}

src/Microsoft.CodeAnalysis.NetAnalyzers/src/Microsoft.CodeAnalysis.CSharp.NetAnalyzers/Microsoft.CodeQuality.Analyzers/ApiDesignGuidelines/CSharpDoNotHideBaseClassMethods.Fixer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information.
22

33
using System.Composition;
4-
using Microsoft.CodeQuality.Analyzers.ApiDesignGuidelines;
54
using Microsoft.CodeAnalysis;
65
using Microsoft.CodeAnalysis.CodeFixes;
6+
using Microsoft.CodeQuality.Analyzers.ApiDesignGuidelines;
77

88
namespace Microsoft.CodeQuality.CSharp.Analyzers.ApiDesignGuidelines
99
{

src/Microsoft.CodeAnalysis.NetAnalyzers/src/Microsoft.CodeAnalysis.CSharp.NetAnalyzers/Microsoft.CodeQuality.Analyzers/ApiDesignGuidelines/CSharpEnumStorageShouldBeInt32.Fixer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information.
22

33
using System.Composition;
4-
using Microsoft.CodeQuality.Analyzers.ApiDesignGuidelines;
54
using Microsoft.CodeAnalysis;
65
using Microsoft.CodeAnalysis.CodeFixes;
76
using Microsoft.CodeAnalysis.CSharp.Syntax;
7+
using Microsoft.CodeQuality.Analyzers.ApiDesignGuidelines;
88

99
namespace Microsoft.CodeQuality.CSharp.Analyzers.ApiDesignGuidelines
1010
{

src/Microsoft.CodeAnalysis.NetAnalyzers/src/Microsoft.CodeAnalysis.CSharp.NetAnalyzers/Microsoft.CodeQuality.Analyzers/ApiDesignGuidelines/CSharpEnumsShouldHaveZeroValue.Fixer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information.
22

33
using System.Composition;
4-
using Microsoft.CodeQuality.Analyzers.ApiDesignGuidelines;
54
using Microsoft.CodeAnalysis;
65
using Microsoft.CodeAnalysis.CodeFixes;
6+
using Microsoft.CodeQuality.Analyzers.ApiDesignGuidelines;
77

88
namespace Microsoft.CodeQuality.CSharp.Analyzers.ApiDesignGuidelines
99
{

src/Microsoft.CodeAnalysis.NetAnalyzers/src/Microsoft.CodeAnalysis.CSharp.NetAnalyzers/Microsoft.CodeQuality.Analyzers/ApiDesignGuidelines/CSharpIdentifiersShouldHaveCorrectPrefix.Fixer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information.
22

33
using System.Composition;
4-
using Microsoft.CodeQuality.Analyzers.ApiDesignGuidelines;
54
using Microsoft.CodeAnalysis;
65
using Microsoft.CodeAnalysis.CodeFixes;
6+
using Microsoft.CodeQuality.Analyzers.ApiDesignGuidelines;
77

88
namespace Microsoft.CodeQuality.CSharp.Analyzers.ApiDesignGuidelines
99
{
@@ -14,4 +14,4 @@ namespace Microsoft.CodeQuality.CSharp.Analyzers.ApiDesignGuidelines
1414
public class CSharpIdentifiersShouldHaveCorrectPrefixFixer : IdentifiersShouldHaveCorrectPrefixFixer
1515
{
1616
}
17-
}
17+
}

src/Microsoft.CodeAnalysis.NetAnalyzers/src/Microsoft.CodeAnalysis.CSharp.NetAnalyzers/Microsoft.CodeQuality.Analyzers/ApiDesignGuidelines/CSharpIdentifiersShouldHaveCorrectSuffix.Fixer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information.
22

33
using System.Composition;
4-
using Microsoft.CodeQuality.Analyzers.ApiDesignGuidelines;
54
using Microsoft.CodeAnalysis;
65
using Microsoft.CodeAnalysis.CodeFixes;
6+
using Microsoft.CodeQuality.Analyzers.ApiDesignGuidelines;
77

88
namespace Microsoft.CodeQuality.CSharp.Analyzers.ApiDesignGuidelines
99
{
@@ -14,4 +14,4 @@ namespace Microsoft.CodeQuality.CSharp.Analyzers.ApiDesignGuidelines
1414
public sealed class CSharpIdentifiersShouldHaveCorrectSuffixFixer : IdentifiersShouldHaveCorrectSuffixFixer
1515
{
1616
}
17-
}
17+
}

src/Microsoft.CodeAnalysis.NetAnalyzers/src/Microsoft.CodeAnalysis.CSharp.NetAnalyzers/Microsoft.CodeQuality.Analyzers/ApiDesignGuidelines/CSharpIdentifiersShouldNotContainUnderscores.Fixer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information.
22

33
using System.Composition;
4-
using Microsoft.CodeQuality.Analyzers.ApiDesignGuidelines;
54
using Microsoft.CodeAnalysis;
65
using Microsoft.CodeAnalysis.CodeFixes;
76
using Microsoft.CodeAnalysis.CSharp;
7+
using Microsoft.CodeQuality.Analyzers.ApiDesignGuidelines;
88

99
namespace Microsoft.CodeQuality.CSharp.Analyzers.ApiDesignGuidelines
1010
{

src/Microsoft.CodeAnalysis.NetAnalyzers/src/Microsoft.CodeAnalysis.CSharp.NetAnalyzers/Microsoft.CodeQuality.Analyzers/ApiDesignGuidelines/CSharpIdentifiersShouldNotHaveIncorrectSuffix.Fixer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information.
22

33
using System.Composition;
4-
using Microsoft.CodeQuality.Analyzers.ApiDesignGuidelines;
54
using Microsoft.CodeAnalysis;
65
using Microsoft.CodeAnalysis.CodeFixes;
6+
using Microsoft.CodeQuality.Analyzers.ApiDesignGuidelines;
77

88
namespace Microsoft.CodeQuality.CSharp.Analyzers.ApiDesignGuidelines
99
{
@@ -14,4 +14,4 @@ namespace Microsoft.CodeQuality.CSharp.Analyzers.ApiDesignGuidelines
1414
public sealed class CSharpIdentifiersShouldNotHaveIncorrectSuffixFixer : IdentifiersShouldNotHaveIncorrectSuffixFixer
1515
{
1616
}
17-
}
17+
}

0 commit comments

Comments
 (0)