Skip to content

Disable CA1510 for shared files #6428

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

Conversation

mavasani
Copy link

@mavasani mavasani commented Jan 12, 2023

This broke with #6364.

See the following CI errors on all PRs with sources from main:

Build FAILED.

/mnt/vss/_work/1/s/src/Utilities/Compiler/Extensions/StringExtensions.cs(12,13): error CA1510: Use 'ArgumentNullException.ThrowIfNull' instead of explicitly throwing a new exception instance [/mnt/vss/_work/1/s/src/Test.Utilities/Test.Utilities.csproj]
/mnt/vss/_work/1/s/src/Utilities/Compiler/Extensions/StringExtensions.cs(17,13): error CA1510: Use 'ArgumentNullException.ThrowIfNull' instead of explicitly throwing a new exception instance [/mnt/vss/_work/1/s/src/Test.Utilities/Test.Utilities.csproj]
/mnt/vss/_work/1/s/src/Utilities/Compiler/Extensions/SourceTextExtensions.cs(25,13): error CA1510: Use 'ArgumentNullException.ThrowIfNull' instead of explicitly throwing a new exception instance [/mnt/vss/_work/1/s/src/Test.Utilities/Test.Utilities.csproj]
/mnt/vss/_work/1/s/src/Utilities/Compiler/Extensions/SourceTextExtensions.cs(30,13): error CA1510: Use 'ArgumentNullException.ThrowIfNull' instead of explicitly throwing a new exception instance [/mnt/vss/_work/1/s/src/Test.Utilities/Test.Utilities.csproj]
/mnt/vss/_work/1/s/src/Utilities/Compiler/Extensions/IEnumerableExtensions.cs(16,13): error CA1510: Use 'ArgumentNullException.ThrowIfNull' instead of explicitly throwing a new exception instance [/mnt/vss/_work/1/s/src/Test.Utilities/Test.Utilities.csproj]
/mnt/vss/_work/1/s/src/Utilities/Compiler/Extensions/IEnumerableExtensions.cs(36,13): error CA1510: Use 'ArgumentNullException.ThrowIfNull' instead of explicitly throwing a new exception instance [/mnt/vss/_work/1/s/src/Test.Utilities/Test.Utilities.csproj]
/mnt/vss/_work/1/s/src/Utilities/Compiler/Extensions/StringExtensions.cs(27,13): error CA1510: Use 'ArgumentNullException.ThrowIfNull' instead of explicitly throwing a new exception instance [/mnt/vss/_work/1/s/src/Test.Utilities/Test.Utilities.csproj]
/mnt/vss/_work/1/s/src/Utilities/Compiler/Extensions/StringExtensions.cs(32,13): error CA1510: Use 'ArgumentNullException.ThrowIfNull' instead of explicitly throwing a new exception instance [/mnt/vss/_work/1/s/src/Test.Utilities/Test.Utilities.csproj]
/mnt/vss/_work/1/s/src/Utilities/Compiler/Extensions/IEnumerableExtensions.cs(113,13): error CA1510: Use 'ArgumentNullException.ThrowIfNull' instead of explicitly throwing a new exception instance [/mnt/vss/_work/1/s/src/Test.Utilities/Test.Utilities.csproj]
/mnt/vss/_work/1/s/src/Utilities/Compiler/Extensions/IEnumerableExtensions.cs(187,13): error CA1510: Use 'ArgumentNullException.ThrowIfNull' instead of explicitly throwing a new exception instance [/mnt/vss/_work/1/s/src/Test.Utilities/Test.Utilities.csproj]
/mnt/vss/_work/1/s/src/Utilities/Compiler/Extensions/IEnumerableExtensions.cs(150,13): error CA1510: Use 'ArgumentNullException.ThrowIfNull' instead of explicitly throwing a new exception instance [/mnt/vss/_work/1/s/src/Test.Utilities/Test.Utilities.csproj]
/mnt/vss/_work/1/s/src/Utilities/Compiler/Extensions/IOperationExtensions.cs(248,13): error CA1510: Use 'ArgumentNullException.ThrowIfNull' instead of explicitly throwing a new exception instance [/mnt/vss/_work/1/s/src/Test.Utilities/Test.Utilities.csproj]
/mnt/vss/_work/1/s/src/Utilities/Compiler/Extensions/IOperationExtensions.cs(282,13): error CA1510: Use 'ArgumentNullException.ThrowIfNull' instead of explicitly throwing a new exception instance [/mnt/vss/_work/1/s/src/Test.Utilities/Test.Utilities.csproj]
    0 Warning(s)
    13 Error(s)

@mavasani mavasani requested a review from a team as a code owner January 12, 2023 11:12
@mavasani
Copy link
Author

@Youssef1313 @Evangelink @jmarolf Need this PR to fix the build break in the repo.

@mavasani
Copy link
Author

@Youssef1313 @jmarolf It seems all tests are failing after migration to .net7 and no test results are also getting published to AzDo. I am going to revert #6364 for now to unblock CI on the repo.

@mavasani mavasani closed this Jan 12, 2023
@Youssef1313
Copy link
Member

Curious how #6364 got green

@mavasani
Copy link
Author

@Youssef1313 I have tried to push the .NET8 change here. Locally, the tests are still failing for me with the below error:

Message: 
    NuGet.Resolver.NuGetResolverInputException : Unable to find package 'Microsoft.CodeAnalysis'. Existing packages must be restored before performing an install or update.

  Stack Trace: 
PackageResolver.Resolve(PackageResolverContext context, CancellationToken token)
    ReferenceAssemblies.ResolveCoreAsync(String language, CancellationToken cancellationToken) line 272
    ReferenceAssemblies.ResolveAsync(String language, CancellationToken cancellationToken) line 197
    ReferenceAssemblies.ResolveAsync(String language, CancellationToken cancellationToken) line 174
    AnalyzerTest`1.CreateSolutionAsync(ProjectId projectId, EvaluatedProjectState projectState, CancellationToken cancellationToken) line 1235
    AnalyzerTest`1.CreateProjectImplAsync(EvaluatedProjectState primaryProject, ImmutableArray`1 additionalProjects, CancellationToken cancellationToken) line 1050
    AnalyzerTest`1.CreateProjectAsync(EvaluatedProjectState primaryProject, ImmutableArray`1 additionalProjects, CancellationToken cancellationToken) line 1029
    AnalyzerTest`1.GetSolutionAsync(EvaluatedProjectState primaryProject, ImmutableArray`1 additionalProjects, IVerifier verifier, CancellationToken cancellationToken) line 1007
    AnalyzerTest`1.GetSortedDiagnosticsAsync(EvaluatedProjectState primaryProject, ImmutableArray`1 additionalProjects, ImmutableArray`1 analyzers, IVerifier verifier, CancellationToken cancellationToken) line 890
    AnalyzerTest`1.VerifyDiagnosticsAsync(EvaluatedProjectState primaryProject, ImmutableArray`1 additionalProjects, DiagnosticResult[] expected, IVerifier verifier, CancellationToken cancellationToken) line 273
    CodeFixTest`1.RunImplAsync(CancellationToken cancellationToken) line 304
    AnalyzerTest`1.RunAsync(CancellationToken cancellationToken) line 181
    CSharpCodeFixVerifier`2.VerifyCodeFixAsync(String source, DiagnosticResult[] expected, String fixedSource) line 52
    CSharpCodeFixVerifier`2.VerifyCodeFixAsync(String source, String fixedSource) line 38
    FixerWithFixAllFixerTests.CSharp_NoDiagnosticAsync() line 192
    --- End of stack trace from previous location ---

@Youssef1313
Copy link
Member

Never seen this one before. If it passed in CI, would you be able to try cleaning %TEMP% locally? The testing library downloads stuff there and there might be problems with previous downloads being cached? Not sure

@mavasani
Copy link
Author

@Youssef1313 Seems like there are more issues here. I am going to get the revert PR #6429 in. Feel free to push more commits here if you think there is some trivial changes to bring this up.

@mavasani
Copy link
Author

Closing this out as this seems to need more work.

@mavasani mavasani closed this Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants