Skip to main content

fix-analyzer-bug

Use when fixing a Roslynator analyzer false positive or false negative, RCS####, RR####, or CS####/RCF#### regression, incorrect diagnostic reporting, or bug report citing a specific rule id — not when adding new rules.

소스 정보

저장소
dotnet/roslynator
최근 소스 활동
2026년 8월 15일 12:25
감지된 SKILL.md 언어
영어
스타
3,497
포크
298

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

파일 탐색기
2 개 파일

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
fix-analyzer-bug
description
Use when fixing a Roslynator analyzer false positive or false negative, RCS####, RR####, or CS####/RCF#### regression, incorrect diagnostic reporting, or bug report citing a specific rule id — not when adding new rules.
# Fix Analyzer Bug ## Overview Reproduce in an existing test file, minimal code fix, changelog entry. Highest-frequency contributor task. ## When to Use - Analyzer reports when it should not (false positive) - Analyzer misses case it should report (false negative) - Code fix produces wrong transformation - Issue title includes `RCS####`, `RR####`, `CS####`, or `RCF####` **Not for:** new rules (`add-analyzer`, `add-refactoring`, `add-compiler-diagnostic-fix`), deprecation (`deprecate-analyzer-or-refactoring`). For test patterns use in-repo verifiers — not public NuGet testing docs. ## Quick Reference | Prefix | Code | Tests | Verifier | |--------|------|-------|----------| | RCS1 | `Analyzers/CSharp/Analysis/` | `Tests/Analyzers.Tests/` | `AbstractCSharpDiagnosticVerifier` | | RCS0 | `Formatting.Analyzers/CSharp/` | `Tests/Formatting.Analyzers.Tests/` | `AbstractCSharpDiagnosticVerifier` | | RCS9 | `CodeAnalysis.Analyzers/CSharp/` | `Tests/CodeAnalysis.Analyzers.Tests/` | `AbstractCSharpDiagnosticVerifier` | | RR | `Refactorings/CSharp/Refactorings/` | `Tests/Refactorings.Tests/` | `AbstractCSharpRefactoringVerifier` | | CS / RCF | `CodeFixes/CSharp/CodeFixes/` | `Tests/CodeFixes.Tests/` | `AbstractCSharpCompilerDiagnosticFixVerifier` | Search `DiagnosticIdentifiers.X` / `DiagnosticRules.X` / `CompilerDiagnosticIdentifiers.*` in generated files. Roslynator analyzer code fixes live in matching `.CodeFixes` projects. ## Implementation Add `[Fact]` to existing `*Tests.cs` — new file only if none exists. | Case | Method | |------|--------| | False positive | `VerifyNoDiagnosticAsync` | | False negative | `VerifyDiagnosticAsync` with `[|...|]` | | Analyzer/refactoring fix regression | `VerifyDiagnosticAndFixAsync` | | Compiler fix regression | `VerifyFixAsync` (no `[|...|]` markers) | Config-dependent: `options: Options.AddConfigOption(...)`. Verify (adjust project and filter): ```bash cd src && dotnet build Roslynator.sln cd src && dotnet test Tests/Analyzers.Tests --no-build --filter "FullyQualifiedName~RCS####" cd src && dotnet test Tests/CodeFixes.Tests --no-build --filter "FullyQualifiedName~CS####" cd src && dotnet format Roslynator.sln --no-restore --verify-no-changes --severity info ``` Changelog examples: [references/changelog-examples.md](references/changelog-examples.md). ## Pull request When the fix targets a GitHub issue, the PR body **must** include a closing keyword on its own line (same pattern as recent analyzer fix PRs): ```markdown Fixes #NNNN ``` Use `Fixes #NNNN` or `Closes #NNNN`. A markdown link such as `[#1812](https://github.com/dotnet/roslynator/issues/1812)` does **not** create a GitHub issue reference and will not auto-close the issue. In `CHANGELOG.md`, end the entry with `([PR](https://github.com/dotnet/roslynator/pull/NNNN))` (see [references/changelog-examples.md](references/changelog-examples.md)). Do not use an issue link there. Place `Fixes #NNNN` after the Summary bullets and before the Test plan, for example: ```markdown ## Summary - … Fixes #1812 ## Test plan - … ``` ## Common Mistakes | Mistake | Fix | |---------|-----| | Copy test pattern from `analyzers-testing.md` | In-repo `AbstractCSharpDiagnosticVerifier` + `DiagnosticRules.X` | | Copy from `compiler-diagnostic-fixes-testing.md` | In-repo `AbstractCSharpCompilerDiagnosticFixVerifier` + `CompilerDiagnosticIdentifiers.*` | | New test file per case | Extend existing `RCS####...Tests.cs` or `CS####...Tests.cs` | | Change `Analyzers.xml` for logic bugs | Metadata only for docs/severity defaults | | `[|...|]` in compiler fix tests | Compiler diagnostic location is implicit | | Full test suite | Filter by rule id is enough | | Skip test | CONTRIBUTING.md requires tests for bug fixes | | Changelog ends with issue link (`[#NNNN](.../issues/...)`) | End with `([PR](https://github.com/dotnet/roslynator/pull/NNNN))` | | Markdown-only issue link in PR body | Use `Fixes #NNNN` so GitHub links and auto-closes the issue |
GitHub에서 보기