Skip to content
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

SA1402: Include only relevant using statements #3873

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Added more tests

b6cf950
Select commit
Loading
Failed to load commit list.
Open

SA1402: Include only relevant using statements #3873

Added more tests
b6cf950
Select commit
Loading
Failed to load commit list.
Azure Pipelines / DotNetAnalyzers.StyleCopAnalyzers failed Jul 31, 2024 in 26m 23s

Build #1.2.0-beta.617+ge990e709c7 had test failures

Details

Tests

  • Failed: 156 (0.33%)
  • Passed: 47,786 (99.67%)
  • Other: 0 (0.00%)
  • Total: 47,942

Annotations

Check failure on line 11 in Build log

See this annotation in the file changed.

@azure-pipelines azure-pipelines / DotNetAnalyzers.StyleCopAnalyzers

Build log #L11

Artifact coverageResults-cs12 was not found for build 6259.

Check failure on line 702 in Build log

See this annotation in the file changed.

@azure-pipelines azure-pipelines / DotNetAnalyzers.StyleCopAnalyzers

Build log #L702

PowerShell exited with code '1'.

Check failure on line 492 in Build log

See this annotation in the file changed.

@azure-pipelines azure-pipelines / DotNetAnalyzers.StyleCopAnalyzers

Build log #L492

PowerShell exited with code '1'.

Check failure on line 11 in Build log

See this annotation in the file changed.

@azure-pipelines azure-pipelines / DotNetAnalyzers.StyleCopAnalyzers

Build log #L11

Artifact coverageResults-cs8 was not found for build 6259.

Check failure on line 1 in StyleCop.Analyzers.Test.MaintainabilityRules.SA1403UnitTests.TestCodeFixRemovesUnnecessaryUsingsFromSecondFileOnlyAsync

See this annotation in the file changed.

@azure-pipelines azure-pipelines / DotNetAnalyzers.StyleCopAnalyzers

StyleCop.Analyzers.Test.MaintainabilityRules.SA1403UnitTests.TestCodeFixRemovesUnnecessaryUsingsFromSecondFileOnlyAsync

System.InvalidOperationException : The markup location '#0' was not found in the input.
Raw output
   at Microsoft.CodeAnalysis.Testing.DiagnosticResult.WithAppliedMarkupLocations(ImmutableDictionary`2 markupLocations) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/DiagnosticResult.cs:line 387
   at Microsoft.CodeAnalysis.Testing.SolutionState.WithProcessedMarkup(MarkupOptions markupOptions, DiagnosticDescriptor defaultDiagnostic, ImmutableArray`1 supportedDiagnostics, ImmutableArray`1 fixableDiagnostics, String defaultPath) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/SolutionState.cs:line 330
   at Microsoft.CodeAnalysis.Testing.CodeFixTest`1.<RunImplAsync>d__44.MoveNext() in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.CodeFix.Testing/CodeFixTest`1.cs:line 299
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at Microsoft.CodeAnalysis.Testing.AnalyzerTest`1.<RunAsync>d__61.MoveNext() in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/AnalyzerTest`1.cs:line 172
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()
   at StyleCop.Analyzers.Test.MaintainabilityRules.FileMayOnlyContainTestBase.<TestCodeFixRemovesUnnecessaryUsingsFromSecondFileOnlyAsync>d__17.MoveNext() in D:\a\1\s\StyleCop.Analyzers\StyleCop.Analyzers.Test\MaintainabilityRules\FileMayOnlyContainTestBase.cs:line 470
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()

Check failure on line 1 in StyleCop.Analyzers.Test.MaintainabilityRules.SA1403UnitTests.TestCodeWithSameConditionalCompilationDirectivesAsync

See this annotation in the file changed.

@azure-pipelines azure-pipelines / DotNetAnalyzers.StyleCopAnalyzers

StyleCop.Analyzers.Test.MaintainabilityRules.SA1403UnitTests.TestCodeWithSameConditionalCompilationDirectivesAsync

System.InvalidOperationException : The markup location '#0' was not found in the input.
Raw output
   at Microsoft.CodeAnalysis.Testing.DiagnosticResult.WithAppliedMarkupLocations(ImmutableDictionary`2 markupLocations) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/DiagnosticResult.cs:line 387
   at Microsoft.CodeAnalysis.Testing.SolutionState.WithProcessedMarkup(MarkupOptions markupOptions, DiagnosticDescriptor defaultDiagnostic, ImmutableArray`1 supportedDiagnostics, ImmutableArray`1 fixableDiagnostics, String defaultPath) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/SolutionState.cs:line 330
   at Microsoft.CodeAnalysis.Testing.CodeFixTest`1.<RunImplAsync>d__44.MoveNext() in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.CodeFix.Testing/CodeFixTest`1.cs:line 299
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at Microsoft.CodeAnalysis.Testing.AnalyzerTest`1.<RunAsync>d__61.MoveNext() in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/AnalyzerTest`1.cs:line 172
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()
   at StyleCop.Analyzers.Test.MaintainabilityRules.FileMayOnlyContainTestBase.<TestCodeWithSameConditionalCompilationDirectivesAsync>d__21.MoveNext() in D:\a\1\s\StyleCop.Analyzers\StyleCop.Analyzers.Test\MaintainabilityRules\FileMayOnlyContainTestBase.cs:line 694
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()

Check failure on line 1 in StyleCop.Analyzers.Test.MaintainabilityRules.SA1403UnitTests.TestCodeFixWithDifferentPreprocessorDirectivesAsync

See this annotation in the file changed.

@azure-pipelines azure-pipelines / DotNetAnalyzers.StyleCopAnalyzers

StyleCop.Analyzers.Test.MaintainabilityRules.SA1403UnitTests.TestCodeFixWithDifferentPreprocessorDirectivesAsync

System.InvalidOperationException : The markup location '#0' was not found in the input.
Raw output
   at Microsoft.CodeAnalysis.Testing.DiagnosticResult.WithAppliedMarkupLocations(ImmutableDictionary`2 markupLocations) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/DiagnosticResult.cs:line 387
   at Microsoft.CodeAnalysis.Testing.SolutionState.WithProcessedMarkup(MarkupOptions markupOptions, DiagnosticDescriptor defaultDiagnostic, ImmutableArray`1 supportedDiagnostics, ImmutableArray`1 fixableDiagnostics, String defaultPath) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/SolutionState.cs:line 330
   at Microsoft.CodeAnalysis.Testing.CodeFixTest`1.<RunImplAsync>d__44.MoveNext() in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.CodeFix.Testing/CodeFixTest`1.cs:line 299
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at Microsoft.CodeAnalysis.Testing.AnalyzerTest`1.<RunAsync>d__61.MoveNext() in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/AnalyzerTest`1.cs:line 172
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()
   at StyleCop.Analyzers.Test.MaintainabilityRules.FileMayOnlyContainTestBase.<TestCodeFixWithDifferentPreprocessorDirectivesAsync>d__22.MoveNext() in D:\a\1\s\StyleCop.Analyzers\StyleCop.Analyzers.Test\MaintainabilityRules\FileMayOnlyContainTestBase.cs:line 755
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()

Check failure on line 1 in StyleCop.Analyzers.Test.MaintainabilityRules.SA1403UnitTests.TestCodeWithTrailingBlankLinesAfterUsingDirectiveAsync

See this annotation in the file changed.

@azure-pipelines azure-pipelines / DotNetAnalyzers.StyleCopAnalyzers

StyleCop.Analyzers.Test.MaintainabilityRules.SA1403UnitTests.TestCodeWithTrailingBlankLinesAfterUsingDirectiveAsync

System.InvalidOperationException : The markup location '#0' was not found in the input.
Raw output
   at Microsoft.CodeAnalysis.Testing.DiagnosticResult.WithAppliedMarkupLocations(ImmutableDictionary`2 markupLocations) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/DiagnosticResult.cs:line 387
   at Microsoft.CodeAnalysis.Testing.SolutionState.WithProcessedMarkup(MarkupOptions markupOptions, DiagnosticDescriptor defaultDiagnostic, ImmutableArray`1 supportedDiagnostics, ImmutableArray`1 fixableDiagnostics, String defaultPath) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/SolutionState.cs:line 330
   at Microsoft.CodeAnalysis.Testing.CodeFixTest`1.<RunImplAsync>d__44.MoveNext() in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.CodeFix.Testing/CodeFixTest`1.cs:line 299
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at Microsoft.CodeAnalysis.Testing.AnalyzerTest`1.<RunAsync>d__61.MoveNext() in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/AnalyzerTest`1.cs:line 172
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()
   at StyleCop.Analyzers.Test.MaintainabilityRules.FileMayOnlyContainTestBase.<TestCodeWithTrailingBlankLinesAfterUsingDirectiveAsync>d__26.MoveNext() in D:\a\1\s\StyleCop.Analyzers\StyleCop.Analyzers.Test\MaintainabilityRules\FileMayOnlyContainTestBase.cs:line 994
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()