Skip to content

refactor: Update AsShouldBeUsedOnlyForInterfaceAnalyzer description and category#669

Closed
rjmurillo wants to merge 10 commits intomainfrom
refactor/issue-648
Closed

refactor: Update AsShouldBeUsedOnlyForInterfaceAnalyzer description and category#669
rjmurillo wants to merge 10 commits intomainfrom
refactor/issue-648

Conversation

@rjmurillo
Copy link
Copy Markdown
Owner

@rjmurillo rjmurillo commented Jul 28, 2025

Update src/Analyzers/AsShouldBeUsedOnlyForInterfaceAnalyzer.cs to use proper messaging and category

Fixes #648

Summary by CodeRabbit

  • New Features

    • Added a new analyzer rule (Moq1300) to enforce correct usage of As<T>() with interfaces only, providing detailed error messages and documentation links.
  • Bug Fixes

    • Improved diagnostic messages to specify the non-interface type used with As<T>().
  • Documentation

    • Updated documentation for Moq1300 with category and code fix information.
    • Simplified task list formatting in issue templates.
    • Expanded contributor guidelines for task processing and error handling.
    • Clarified analyzer release documentation protocols.
  • Chores

    • Streamlined Codacy configuration by reducing supported runtimes and analysis tools.

- Updates diagnostic message and description for clarity

- Corrects the diagnostic category to Moq

Fixes #648
…instructions

- Added a new rule to load `./.github/copilot-instructions.md` and `./.github/instructions/README.md` before starting any work on sub-tasks.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jul 28, 2025

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

📥 Commits

Reviewing files that changed from the base of the PR and between b3f4063 and d13fda2.

📒 Files selected for processing (1)
  • src/Analyzers/AnalyzerReleases.Unshipped.md (1 hunks)
 _____________________
< Git gud or git out. >
 ---------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
📝 Walkthrough

Walkthrough

This change updates analyzer metadata and documentation for the AsShouldBeUsedOnlyForInterfaceAnalyzer. It revises the diagnostic message to include the type name, moves the original message to the description, and changes the category to "Usage". Associated documentation, release notes, and configuration files are updated for consistency. Additional rules and clarifications are added to contributor instructions and process documentation.

Changes

Cohort / Files Change Summary
Analyzer logic & metadata:
src/Analyzers/AsShouldBeUsedOnlyForInterfaceAnalyzer.cs
src/Common/DiagnosticCategory.cs
Diagnostic message updated to include type name; message moved to description; category changed to "Usage"; new constant added.
Analyzer release notes:
src/Analyzers/AnalyzerReleases.Unshipped.md
Moq1300 rule reclassified: category set to "Usage", severity to "Error", note added.
Rule documentation:
docs/rules/Moq1300.md
Added "Category: Usage" to summary; changed "CodeFix" value from "False" to "No".
Contributor instructions:
.github/copilot-instructions.md
Added rules for handling build failures and prohibiting changes to AnalyzerReleases.Shipped.md.
Process documentation:
.cursor/rules/process-task-list.md
Expanded with rules for loading instructions, handling build/test failures, and revised PR completion protocol.
Task list documentation:
.cursor/rules/generate-tasks.md
Checklist item format simplified to reference only issue numbers (e.g., - [ ] #456).
Codacy configuration:
.codacy/codacy.yaml
Removed Dart, Go, Java, Node runtimes and related tools; retained only Python and selected analysis tools.
Codacy usage rules:
.cursor/rules/codacy.mdc
Removed rules about fixed parameter values and unnecessary git remote -v calls.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Analyzer
    participant DiagnosticCategory

    User->>Analyzer: Calls As<T>() with non-interface type
    Analyzer->>DiagnosticCategory: Uses Usage category
    Analyzer->>Analyzer: Checks if T is interface
    alt T is not interface
        Analyzer->>User: Reports diagnostic "Type '{T}' is not an interface"
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested reviewers

  • MattKotsenas
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/issue-648

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@rjmurillo
Copy link
Copy Markdown
Owner Author

Reviewer note: I'm A/B against #668

@rjmurillo rjmurillo changed the title Refactor/issue 648 refactor: Update AsShouldBeUsedOnlyForInterfaceAnalyzer description and category Jul 28, 2025
@codacy-production
Copy link
Copy Markdown

codacy-production bot commented Jul 28, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.02% (target: -1.00%) 100.00% (target: 95.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (1d5a6d0) 1830 1635 89.34%
Head commit (d13fda2) 1834 (+4) 1639 (+4) 89.37% (+0.02%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#669) 8 8 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

- Adds 'Usage' to DiagnosticCategory

- Updates AsShouldBeUsedOnlyForInterfaceAnalyzer to use 'Usage' category

- Updates shipped and unshipped release files

Fixes #648
- Added a new rule to treat build and test failures as critical stop conditions, emphasizing the need to diagnose and fix issues before proceeding with tasks.
- Updated the task list management documentation to ensure clarity on handling build failures and the importance of following the completion protocol.
…ion process

- Enhanced the task implementation section to include a new step for user verification before marking tasks as completed.
- Added guidance on how to format commit messages, emphasizing the use of the convention commit format and the importance of descriptive bodies that reference related tasks.

This update aims to improve clarity in task management and ensure proper communication of changes made.
- Added a critical note emphasizing that `AnalyzerReleases.Shipped.md` is immutable and should not be modified.
- All changes to existing rules, including category or severity updates, must be documented in `AnalyzerReleases.Unshipped.md`.

This update aims to ensure proper documentation practices and maintain the integrity of release records.
- Changed the category of Moq1300 from 'Usage' to 'Moq' in AnalyzerReleases.Shipped.md.
- Added a new section for changed rules in AnalyzerReleases.Unshipped.md to document the update.

This update ensures accurate categorization and clarity in the release notes.
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1d5a6d0 and b3f4063.

📒 Files selected for processing (9)
  • .codacy/codacy.yaml (0 hunks)
  • .cursor/rules/codacy.mdc (0 hunks)
  • .cursor/rules/generate-tasks.md (2 hunks)
  • .cursor/rules/process-task-list.md (2 hunks)
  • .github/copilot-instructions.md (2 hunks)
  • docs/rules/Moq1300.md (1 hunks)
  • src/Analyzers/AnalyzerReleases.Unshipped.md (1 hunks)
  • src/Analyzers/AsShouldBeUsedOnlyForInterfaceAnalyzer.cs (3 hunks)
  • src/Common/DiagnosticCategory.cs (1 hunks)
💤 Files with no reviewable changes (2)
  • .codacy/codacy.yaml
  • .cursor/rules/codacy.mdc
🧰 Additional context used
📓 Path-based instructions (10)
{docs/rules/**,README.md}

📄 CodeRabbit Inference Engine (.github/copilot-instructions.md)

{docs/rules/**,README.md}: Update docs/rules/ and README.md for any analyzer, code fix, or workflow change
Update docs/rules/ and README.md if you add or change any analyzer, code fix, or workflow
Always update documentation for new features, API changes, or workflow/process changes

Files:

  • docs/rules/Moq1300.md
{src/Analyzers/AnalyzerReleases.Unshipped.md,docs/rules/**}

📄 CodeRabbit Inference Engine (.github/copilot-instructions.md)

Update src/Analyzers/AnalyzerReleases.Unshipped.md and add or update documentation in docs/rules/ for each diagnostic

Files:

  • docs/rules/Moq1300.md
  • src/Analyzers/AnalyzerReleases.Unshipped.md
**/*.md

📄 CodeRabbit Inference Engine (CONTRIBUTING.md)

All documentation and markdown reports must pass formatting checks. Use a markdown linter if available.

Files:

  • docs/rules/Moq1300.md
  • src/Analyzers/AnalyzerReleases.Unshipped.md
docs/rules/**/*.md

📄 CodeRabbit Inference Engine (CONTRIBUTING.md)

Update 'docs/rules/' for analyzer changes.

Files:

  • docs/rules/Moq1300.md

⚙️ CodeRabbit Configuration File

Evaluate the markdown files against the standards for Roslyn Code Analysis rules

Files:

  • docs/rules/Moq1300.md
src/Analyzers/AnalyzerReleases.Unshipped.md

📄 CodeRabbit Inference Engine (CONTRIBUTING.md)

Update 'src/Analyzers/AnalyzerReleases.Unshipped.md' for release notes.

Files:

  • src/Analyzers/AnalyzerReleases.Unshipped.md
**/*.cs

📄 CodeRabbit Inference Engine (.github/copilot-instructions.md)

Do not add or duplicate usings covered by src/Common/GlobalUsings.cs

**/*.cs: Add XML documentation for all public APIs.
Use tags for all type references in XML documentation instead of plain text.
Use for C# keywords in XML documentation.
Use for parameter references in XML documentation.
Use .. for inline code snippets in XML documentation.
All public APIs must have complete XML documentation with accurate and up-to-date information.

Files:

  • src/Analyzers/AsShouldBeUsedOnlyForInterfaceAnalyzer.cs
  • src/Common/DiagnosticCategory.cs

⚙️ CodeRabbit Configuration File

**/*.cs: I need your help tracking down and fixing some bugs that have been reported in this codebase.

I suspect the bugs are related to:

  • Incorrect handling of edge cases
  • Off-by-one errors in loops or array indexing
  • Unexpected data types
  • Uncaught exceptions
  • Concurrency issues
  • Improper configuration settings

To diagnose:

  1. Review the code carefully and systematically
  2. Trace the relevant code paths
  3. Consider boundary conditions and potential error states
  4. Look for antipatterns that tend to cause bugs
  5. Run the code mentally with example inputs
  6. Think about interactions between components

When you find potential bugs, for each one provide:

  1. File path and line number(s)
  2. Description of the issue and why it's a bug
  3. Example input that would trigger the bug
  4. Suggestions for how to fix it

After analysis, please update the code with your proposed fixes. Try to match the existing code style. Add regression tests if possible to prevent the bugs from recurring.

I appreciate your diligence and attention to detail! Let me know if you need any clarification on the intended behavior of the code.

Files:

  • src/Analyzers/AsShouldBeUsedOnlyForInterfaceAnalyzer.cs
  • src/Common/DiagnosticCategory.cs
{src/Analyzers/*Analyzer.cs,src/CodeFixes/*Fixer.cs,tests/Moq.Analyzers.Test/*AnalyzerTests.cs,tests/Moq.Analyzers.Test/*CodeFixTests.cs}

📄 CodeRabbit Inference Engine (.github/copilot-instructions.md)

Use [Description]Analyzer.cs, [Description]Fixer.cs, [Description]AnalyzerTests.cs, [Description]CodeFixTests.cs for new components

Files:

  • src/Analyzers/AsShouldBeUsedOnlyForInterfaceAnalyzer.cs
{src/Analyzers/**/*.cs,src/CodeFixes/**/*.cs,src/Common/**/*.cs}

📄 CodeRabbit Inference Engine (.github/copilot-instructions.md)

Place new analyzers in src/Analyzers/, code fixes in src/CodeFixes/, and shared logic in src/Common/

Files:

  • src/Analyzers/AsShouldBeUsedOnlyForInterfaceAnalyzer.cs
  • src/Common/DiagnosticCategory.cs
**/*.{cs,csproj,sln}

📄 CodeRabbit Inference Engine (CONTRIBUTING.md)

Build with 'dotnet build /p:PedanticMode=true'. All warnings must be treated as errors. PRs that do not build cleanly will be closed.

Files:

  • src/Analyzers/AsShouldBeUsedOnlyForInterfaceAnalyzer.cs
  • src/Common/DiagnosticCategory.cs
src/**/*.cs

📄 CodeRabbit Inference Engine (CONTRIBUTING.md)

All diagnostic spans in Roslyn analyzers MUST be character-precise. A test failure related to a diagnostic span is a CRITICAL FAILURE and must be addressed immediately.

Files:

  • src/Analyzers/AsShouldBeUsedOnlyForInterfaceAnalyzer.cs
  • src/Common/DiagnosticCategory.cs
🧠 Learnings (8)
📓 Common learnings
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.110Z
Learning: Reference affected analyzer rule IDs in PR descriptions.
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: If your PR changes or adds analyzer tests, include a note in the PR description about which Moq versions are targeted and how test data is grouped accordingly.
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Applies to {src/Analyzers/*Analyzer.cs,src/CodeFixes/*Fixer.cs,tests/Moq.Analyzers.Test/*AnalyzerTests.cs,tests/Moq.Analyzers.Test/*CodeFixTests.cs} : Use [Description]Analyzer.cs, [Description]Fixer.cs, [Description]AnalyzerTests.cs, [Description]CodeFixTests.cs for new components
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.110Z
Learning: Summarize all changes in the PR description and cite relevant lines from modified files for clarity.
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: Applies to src/Analyzers/AnalyzerReleases.Unshipped.md : Update 'src/Analyzers/AnalyzerReleases.Unshipped.md' for release notes.
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Applies to tests/Moq.Analyzers.Test/**/*.cs : Add or update unit tests in tests/Moq.Analyzers.Test/ for every analyzer or code fix change
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: Applies to tests/Moq.Analyzers.Benchmarks/**/*.cs : Performance-sensitive changes require benchmark validation. Run performance tests locally before submitting PRs and include performance regression analysis in PR description.
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.111Z
Learning: Use [Description]Analyzer.cs, [Description]Fixer.cs, [Description]AnalyzerTests.cs, [Description]CodeFixTests.cs for new components.
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: Applies to **/*.{cs} : Run Codacy CLI analysis on all changed files and fix all reported issues before submitting the PR.
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Applies to {src/Analyzers/AnalyzerReleases.Unshipped.md,docs/rules/**} : Update src/Analyzers/AnalyzerReleases.Unshipped.md and add or update documentation in docs/rules/ for each diagnostic
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.110Z
Learning: If changing an analyzer, update documentation in 'docs/rules' to reflect all changes.
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.110Z
Learning: If adding an analyzer, also add a code fix, a benchmark, and documentation in 'docs/rules'.
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: Applies to docs/rules/**/*.md : Update 'docs/rules/' for analyzer changes.
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Applies to {docs/rules/**,README.md} : Update docs/rules/ and README.md for any analyzer, code fix, or workflow change
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Applies to {docs/rules/**,README.md} : Update docs/rules/ and README.md if you add or change any analyzer, code fix, or workflow
docs/rules/Moq1300.md (19)

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: Applies to tests/**/*.cs : In code fix tests, the code that triggers the analyzer MUST be wrapped with the diagnostic marker syntax (e.g., {|Moq1210:...|}).

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Applies to tests/Moq.Analyzers.Test/**/*.cs : Add or update unit tests in tests/Moq.Analyzers.Test/ for every analyzer or code fix change

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: If your PR changes or adds analyzer tests, include a note in the PR description about which Moq versions are targeted and how test data is grouped accordingly.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: Applies to tests/Moq.Analyzers.Benchmarks/**/*.cs : Performance-sensitive changes require benchmark validation. Run performance tests locally before submitting PRs and include performance regression analysis in PR description.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.111Z
Learning: If a Moq feature has known limitations or edge cases (e.g., explicit interface implementation, event setup), document this in the test or analyzer code.

Learnt from: rjmurillo
PR: rjmurillo/moq.analyzers#0
File: :0-0
Timestamp: 2025-07-22T08:42:51.055Z
Learning: For the moq.analyzers repository, diagnostic IDs follow specific ranges: Moq1000-1099 (Usage), Moq1100-1199 (Correctness), Moq1200-1299 (Correctness), Moq1300-1399 (Usage), Moq1400-1499 (Best Practice), Moq1500-1599 (Best Practice), Moq1600-1999 (Reserved). No analyzers exist above 1600.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Applies to {src/Analyzers/*Analyzer.cs,src/CodeFixes/*Fixer.cs,tests/Moq.Analyzers.Test/*AnalyzerTests.cs,tests/Moq.Analyzers.Test/*CodeFixTests.cs} : Use [Description]Analyzer.cs, [Description]Fixer.cs, [Description]AnalyzerTests.cs, [Description]CodeFixTests.cs for new components

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Note Moq version compatibility for analyzer/test changes

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.110Z
Learning: Do not include tests for features/APIs that do not exist in the targeted Moq version.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: Applies to tests/**/*.cs : Do not include tests for APIs or patterns that do not exist in the targeted Moq version; such tests will fail at compile time.

Learnt from: rjmurillo
PR: rjmurillo/moq.analyzers#0
File: :0-0
Timestamp: 2025-07-22T17:25:24.857Z
Learning: Applies to {src/Analyzers//*.cs,tests//*.cs}: For Moq protected member setups using string-based overloads (e.g., mock.Protected().Setup("MethodName", ...)), use ItExpr matchers instead of It matchers. When using As<T>() interface mapping, regular It matchers are allowed in lambda expressions.

Learnt from: rjmurillo
PR: rjmurillo/moq.analyzers#0
File: :0-0
Timestamp: 2025-07-22T17:25:24.857Z
Learning: Applies to {src/Analyzers//*.cs,tests//*.cs}: For Moq protected member setups using string-based overloads (e.g., mock.Protected().Setup("MethodName", ...)), use ItExpr matchers instead of It matchers. When using As<T>() interface mapping, regular It matchers are allowed in lambda expressions.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.111Z
Learning: Setups for explicit interface implementations must use the correct cast syntax (e.g., ((IMyInterface)x).Method()), and only test these scenarios if the Moq version supports them.

Learnt from: rjmurillo
PR: rjmurillo/moq.analyzers#0
File: :0-0
Timestamp: 2025-07-22T17:25:24.857Z
Learning: Applies to {src/Analyzers//*.cs,tests//*.cs}: Moq protected member APIs that need analyzer validation include: Setup, SetupSequence, SetupGet, SetupSet, Verify, VerifyGet, VerifySet, and As() for interface mapping. All protected members must be virtual or abstract to be mockable.

Learnt from: rjmurillo
PR: rjmurillo/moq.analyzers#0
File: :0-0
Timestamp: 2025-07-22T17:25:24.857Z
Learning: Applies to {src/Analyzers//*.cs,tests//*.cs}: Moq protected member APIs that need analyzer validation include: Setup, SetupSequence, SetupGet, SetupSet, Verify, VerifyGet, VerifySet, and As() for interface mapping. All protected members must be virtual or abstract to be mockable.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Applies to tests/Moq.Analyzers.Test/*CodeFixTests.cs : Use the [MemberData]-annotated [Theory] pattern with a public static IEnumerable<object[]> data source for code fix tests

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: Applies to tests/**/*.cs : Setups for explicit interface implementations must use the correct cast syntax (e.g., ((IMyInterface)x).Method()).

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.110Z
Learning: Group test data by Moq version compatibility: 'new' for Moq 4.18.4+, 'both' or 'old' for features available in both 4.8.2 and 4.18.4.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.111Z
Learning: When testing code fixes that modify a class member, use a data-driven pattern: a public static IEnumerable<object[]> data source, a [Theory] test method with [MemberData], a static Template function with placeholders, and Verify.VerifyCodeFixAsync.

.github/copilot-instructions.md (25)

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Applies to {src/Analyzers/AnalyzerReleases.Unshipped.md,docs/rules/**} : Update src/Analyzers/AnalyzerReleases.Unshipped.md and add or update documentation in docs/rules/ for each diagnostic

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .cursor/rules/csharp.mdc:0-0
Timestamp: 2025-07-19T08:09:48.255Z
Learning: Applies to *.{cs,csproj,sln} : Always read and apply the instructions in copilot-instructions.md when working on C# source or project files

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.111Z
Learning: Always check for and follow any new rules in .cursor/rules/, .editorconfig, and .github/copilot-instructions.md before making changes.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .windsurf/rules/csharp.md:0-0
Timestamp: 2025-07-22T02:59:43.736Z
Learning: Applies to *.{cs,csproj,sln} : Always read and apply the instructions in copilot-instructions.md when working on C# source or project files

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Applies to {docs/rules/**,README.md} : Update docs/rules/ and README.md for any analyzer, code fix, or workflow change

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: Applies to docs/rules/**/*.md : Update 'docs/rules/' for analyzer changes.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: Applies to src/Analyzers/AnalyzerReleases.Unshipped.md : Update 'src/Analyzers/AnalyzerReleases.Unshipped.md' for release notes.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Applies to {docs/rules/**,README.md} : Update docs/rules/ and README.md if you add or change any analyzer, code fix, or workflow

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.110Z
Learning: Reference affected analyzer rule IDs in PR descriptions.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Applies to {docs/rules/**,README.md} : Always update documentation for new features, API changes, or workflow/process changes

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: Never guess which Roslyn API to use. If you are not 100% certain, consult existing, working analyzers in the 'src/' directory.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.111Z
Learning: Never guess which Roslyn API to use; consult existing, working analyzers in src/ if unsure.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: Before working on Roslyn analyzers, you must have expert-level understanding of Roslyn syntax tree navigation, diagnostic span calculation, IOperation vs ISyntaxNode analysis, CodeFixProvider and DocumentEditor patterns, and Moq framework semantics.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.111Z
Learning: When creating a new Roslyn analyzer or code fix, locate an existing, similar component within the src/ directory and replicate its structure, dependency injection, and overall design. Prefer the IOperation-based approach where applicable.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.111Z
Learning: If you cannot truthfully declare expert-level Roslyn knowledge, you must stop and request guidance.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.111Z
Learning: Do not 'fix' a failing test by adjusting code and re-running; fixes must come from a deliberate, correct understanding of the syntax tree.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: Applies to src/**/*.cs : All diagnostic spans in Roslyn analyzers MUST be character-precise. A test failure related to a diagnostic span is a CRITICAL FAILURE and must be addressed immediately.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.111Z
Learning: For Roslyn analyzer development: diagnostic spans must be character-precise; a test failure related to a diagnostic span is a critical failure and requires re-evaluation.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.111Z
Learning: Before implementing an analyzer, verify you can trace the syntax tree path from mock.Verify() to the member access, understand Roslyn expression types, diagnostic span requirements, and when to use IOperation vs ISyntaxNode.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Never copy-and-tweak analyzer patterns. Re-read the requirements before you start.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Applies to {src/Analyzers//*.cs,src/CodeFixes//.cs,src/Common/**/.cs} : Place new analyzers in src/Analyzers/, code fixes in src/CodeFixes/, and shared logic in src/Common/

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Applies to tests/Moq.Analyzers.Test/**/*.cs : Add or update unit tests in tests/Moq.Analyzers.Test/ for every analyzer or code fix change

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Applies to {src/Analyzers/*Analyzer.cs,src/CodeFixes/*Fixer.cs,tests/Moq.Analyzers.Test/*AnalyzerTests.cs,tests/Moq.Analyzers.Test/*CodeFixTests.cs} : Use [Description]Analyzer.cs, [Description]Fixer.cs, [Description]AnalyzerTests.cs, [Description]CodeFixTests.cs for new components

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.111Z
Learning: When making changes, follow the workflow: Edit/Add Code or Test → Run codacy_cli_analyze → Fix issues if any → Run/Update Tests → Fix test failures if any → Update Docs → Commit & PR.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.110Z
Learning: If adding an analyzer, also add a code fix, a benchmark, and documentation in 'docs/rules'.

src/Analyzers/AnalyzerReleases.Unshipped.md (16)

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: Applies to src/Analyzers/AnalyzerReleases.Unshipped.md : Update 'src/Analyzers/AnalyzerReleases.Unshipped.md' for release notes.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Applies to {src/Analyzers/AnalyzerReleases.Unshipped.md,docs/rules/**} : Update src/Analyzers/AnalyzerReleases.Unshipped.md and add or update documentation in docs/rules/ for each diagnostic

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.110Z
Learning: Reference affected analyzer rule IDs in PR descriptions.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Note Moq version compatibility for analyzer/test changes

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: If your PR changes or adds analyzer tests, include a note in the PR description about which Moq versions are targeted and how test data is grouped accordingly.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: Applies to docs/rules/**/*.md : Update 'docs/rules/' for analyzer changes.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Applies to tests/Moq.Analyzers.Test/**/*.cs : Add or update unit tests in tests/Moq.Analyzers.Test/ for every analyzer or code fix change

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Applies to {src/Analyzers/*Analyzer.cs,src/CodeFixes/*Fixer.cs,tests/Moq.Analyzers.Test/*AnalyzerTests.cs,tests/Moq.Analyzers.Test/*CodeFixTests.cs} : Use [Description]Analyzer.cs, [Description]Fixer.cs, [Description]AnalyzerTests.cs, [Description]CodeFixTests.cs for new components

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.110Z
Learning: If changing an analyzer, update documentation in 'docs/rules' to reflect all changes.

Learnt from: rjmurillo
PR: rjmurillo/moq.analyzers#0
File: :0-0
Timestamp: 2025-07-22T08:42:51.055Z
Learning: For the moq.analyzers repository, diagnostic IDs follow specific ranges: Moq1000-1099 (Usage), Moq1100-1199 (Correctness), Moq1200-1299 (Correctness), Moq1300-1399 (Usage), Moq1400-1499 (Best Practice), Moq1500-1599 (Best Practice), Moq1600-1999 (Reserved). No analyzers exist above 1600.

Learnt from: rjmurillo
PR: rjmurillo/moq.analyzers#0
File: :0-0
Timestamp: 2025-07-22T17:25:24.857Z
Learning: Applies to {src/Analyzers//*.cs,tests//*.cs}: Moq protected member APIs that need analyzer validation include: Setup, SetupSequence, SetupGet, SetupSet, Verify, VerifyGet, VerifySet, and As() for interface mapping. All protected members must be virtual or abstract to be mockable.

Learnt from: rjmurillo
PR: rjmurillo/moq.analyzers#0
File: :0-0
Timestamp: 2025-07-22T17:25:24.857Z
Learning: Applies to {src/Analyzers//*.cs,tests//*.cs}: Moq protected member APIs that need analyzer validation include: Setup, SetupSequence, SetupGet, SetupSet, Verify, VerifyGet, VerifySet, and As() for interface mapping. All protected members must be virtual or abstract to be mockable.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: Applies to tests/**/*.cs : In code fix tests, the code that triggers the analyzer MUST be wrapped with the diagnostic marker syntax (e.g., {|Moq1210:...|}).

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.111Z
Learning: Avoid unnecessary complexity in test types and mock setups; each test should demonstrate a single Moq feature or analyzer rule.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.111Z
Learning: If a Moq feature has known limitations or edge cases (e.g., explicit interface implementation, event setup), document this in the test or analyzer code.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: Applies to tests/Moq.Analyzers.Benchmarks/**/*.cs : Performance-sensitive changes require benchmark validation. Run performance tests locally before submitting PRs and include performance regression analysis in PR description.

src/Analyzers/AsShouldBeUsedOnlyForInterfaceAnalyzer.cs (13)

Learnt from: rjmurillo
PR: rjmurillo/moq.analyzers#0
File: :0-0
Timestamp: 2025-07-22T17:25:24.857Z
Learning: Applies to {src/Analyzers//*.cs,tests//*.cs}: For Moq protected member setups using string-based overloads (e.g., mock.Protected().Setup("MethodName", ...)), use ItExpr matchers instead of It matchers. When using As<T>() interface mapping, regular It matchers are allowed in lambda expressions.

Learnt from: rjmurillo
PR: rjmurillo/moq.analyzers#0
File: :0-0
Timestamp: 2025-07-22T17:25:24.857Z
Learning: Applies to {src/Analyzers//*.cs,tests//*.cs}: For Moq protected member setups using string-based overloads (e.g., mock.Protected().Setup("MethodName", ...)), use ItExpr matchers instead of It matchers. When using As<T>() interface mapping, regular It matchers are allowed in lambda expressions.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Applies to {src/Analyzers/*Analyzer.cs,src/CodeFixes/*Fixer.cs,tests/Moq.Analyzers.Test/*AnalyzerTests.cs,tests/Moq.Analyzers.Test/*CodeFixTests.cs} : Use [Description]Analyzer.cs, [Description]Fixer.cs, [Description]AnalyzerTests.cs, [Description]CodeFixTests.cs for new components

Learnt from: rjmurillo
PR: rjmurillo/moq.analyzers#0
File: :0-0
Timestamp: 2025-07-22T17:25:24.857Z
Learning: Applies to {src/Analyzers//*.cs,tests//*.cs}: Moq protected member APIs that need analyzer validation include: Setup, SetupSequence, SetupGet, SetupSet, Verify, VerifyGet, VerifySet, and As() for interface mapping. All protected members must be virtual or abstract to be mockable.

Learnt from: rjmurillo
PR: rjmurillo/moq.analyzers#0
File: :0-0
Timestamp: 2025-07-22T17:25:24.857Z
Learning: Applies to {src/Analyzers//*.cs,tests//*.cs}: Moq protected member APIs that need analyzer validation include: Setup, SetupSequence, SetupGet, SetupSet, Verify, VerifyGet, VerifySet, and As() for interface mapping. All protected members must be virtual or abstract to be mockable.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: Applies to tests/**/*.cs : In code fix tests, the code that triggers the analyzer MUST be wrapped with the diagnostic marker syntax (e.g., {|Moq1210:...|}).

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Note Moq version compatibility for analyzer/test changes

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.111Z
Learning: Setups for explicit interface implementations must use the correct cast syntax (e.g., ((IMyInterface)x).Method()), and only test these scenarios if the Moq version supports them.

Learnt from: rjmurillo
PR: #580
File: tests/Moq.Analyzers.Test/CallbackSignatureShouldMatchMockedMethodAnalyzerTests.cs:116-116
Timestamp: 2025-07-26T15:57:15.819Z
Learning: The CallbackSignatureShouldMatchMockedMethodAnalyzer (Moq1100) currently has a gap where it does not validate generic .Callback() type parameters against the mocked method signature. This can lead to runtime errors when generic callback types don't match the expected method parameters, documented in CallbackSignatureShouldMatchMockedMethodAnalyzerTests.GenericCallbackValidation_CurrentLimitation_IsDocumented(). According to Moq documentation, .Callback should provide compile-time type safety where T must match the argument type of the mocked method.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: Applies to tests/**/*.cs : Only set up or verify virtual, abstract, or interface members in Moq analyzer tests. Do not attempt to set up or verify non-virtual, static, or sealed members.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.111Z
Learning: Avoid unnecessary complexity in test types and mock setups; each test should demonstrate a single Moq feature or analyzer rule.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.111Z
Learning: If a Moq feature has known limitations or edge cases (e.g., explicit interface implementation, event setup), document this in the test or analyzer code.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.110Z
Learning: For Moq analyzers and tests: only set up or verify virtual, abstract, or interface members; do not attempt to set up or verify non-virtual, static, or sealed members.

.cursor/rules/process-task-list.md (26)

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.111Z
Learning: Always check for and follow any new rules in .cursor/rules/, .editorconfig, and .github/copilot-instructions.md before making changes.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .cursor/rules/csharp.mdc:0-0
Timestamp: 2025-07-19T08:09:48.255Z
Learning: Applies to *.{cs,csproj,sln} : Always read and apply the instructions in copilot-instructions.md when working on C# source or project files

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .windsurf/rules/csharp.md:0-0
Timestamp: 2025-07-22T02:59:43.736Z
Learning: Applies to *.{cs,csproj,sln} : Always read and apply the instructions in copilot-instructions.md when working on C# source or project files

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Applies to {docs/rules/**,README.md} : Update docs/rules/ and README.md for any analyzer, code fix, or workflow change

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Applies to {README.md,docs/rules/README.md} : Update README.md and docs/rules/README.md if workflows or rules change

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: Applies to docs/rules/**/*.md : Update 'docs/rules/' for analyzer changes.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.110Z
Learning: Reference affected analyzer rule IDs in PR descriptions.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Applies to {src/Analyzers/AnalyzerReleases.Unshipped.md,docs/rules/**} : Update src/Analyzers/AnalyzerReleases.Unshipped.md and add or update documentation in docs/rules/ for each diagnostic

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Applies to {docs/rules/**,README.md} : Always update documentation for new features, API changes, or workflow/process changes

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Applies to {docs/rules/**,README.md} : Update docs/rules/ and README.md if you add or change any analyzer, code fix, or workflow

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: Applies to tests/**/*.cs : Run all unit tests using 'dotnet test --settings ./build/targets/tests/test.runsettings'. All tests must pass.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Run dotnet test (all must pass)

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.111Z
Learning: When making changes, follow the workflow: Edit/Add Code or Test → Run codacy_cli_analyze → Fix issues if any → Run/Update Tests → Fix test failures if any → Update Docs → Commit & PR.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: Applies to .github/workflows/**/*.yml : When making CI/CD changes, test workflows locally, provide validation evidence, update documentation, and consider performance impact.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Read and comply with all .github/instructions/* for edited file types

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: Applies to **/*.{cs,csproj,sln} : Build with 'dotnet build /p:PedanticMode=true'. All warnings must be treated as errors. PRs that do not build cleanly will be closed.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: Applies to **/*.{cs} : Run 'dotnet format' and commit all changes before submitting a pull request. PRs with formatting issues will be rejected.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.111Z
Learning: Keep commit messages short and in the imperative mood; confirm a clean working tree with git status before committing.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.111Z
Learning: Commit messages: capitalize the first word, do not end in punctuation, use imperative mood, keep the first line under 50 characters, and be direct and informative.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .cursor/rules/conventional-commit-messages.mdc:0-0
Timestamp: 2025-07-19T08:09:45.503Z
Learning: Use the Conventional Commit Messages specification to generate commit messages, structuring them as: [optional scope]: [optional body] [optional footer(s)]

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: Use descriptive branch names following the pattern: 'feature/issue-{number}' for new features, 'fix/issue-{number}' for bug fixes, 'docs/issue-{number}' for documentation changes, 'ci/issue-{number}' for CI/CD improvements, 'chore/issue-{number}' for maintenance tasks.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .cursor/rules/conventional-commit-messages.mdc:0-0
Timestamp: 2025-06-25T12:42:55.421Z
Learning: Commit messages in this project must follow the Conventional Commit Messages specification, which requires a structure of [optional scope]: , with optional body and footers.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.110Z
Learning: Each commit must focus on a single, self-contained change ('one idea, one commit') and keep commit messages under 50 characters when possible.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: Follow the Conventional Commits specification for commit messages: [optional scope]: .

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .cursor/rules/conventional-commit-messages.mdc:0-0
Timestamp: 2025-06-25T12:42:54.674Z
Learning: Commit messages in this codebase must follow the Conventional Commit Messages specification, which requires a structure of [optional scope]: , with optional body and footers.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Ensure all changes are covered by tests and documentation before committing

.cursor/rules/generate-tasks.md (18)

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: Applies to README.md : Update README for significant changes.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Applies to {docs/rules/**,README.md} : Always update documentation for new features, API changes, or workflow/process changes

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: Applies to docs/rules/**/*.md : Update 'docs/rules/' for analyzer changes.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.110Z
Learning: Summarize all changes in the PR description and cite relevant lines from modified files for clarity.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Applies to {docs/rules/**,README.md} : Update docs/rules/ and README.md for any analyzer, code fix, or workflow change

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: Applies to **/CONTRIBUTING.md : Update contributing guidelines for workflow changes.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Applies to {README.md,docs/rules/README.md} : Update README.md and docs/rules/README.md if workflows or rules change

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: Use descriptive branch names following the pattern: 'feature/issue-{number}' for new features, 'fix/issue-{number}' for bug fixes, 'docs/issue-{number}' for documentation changes, 'ci/issue-{number}' for CI/CD improvements, 'chore/issue-{number}' for maintenance tasks.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Applies to {docs/rules/**,README.md} : Update docs/rules/ and README.md if you add or change any analyzer, code fix, or workflow

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Applies to {src/Analyzers/AnalyzerReleases.Unshipped.md,docs/rules/**} : Update src/Analyzers/AnalyzerReleases.Unshipped.md and add or update documentation in docs/rules/ for each diagnostic

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.111Z
Learning: When making changes, follow the workflow: Edit/Add Code or Test → Run codacy_cli_analyze → Fix issues if any → Run/Update Tests → Fix test failures if any → Update Docs → Commit & PR.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Applies to {src/Analyzers/*Analyzer.cs,src/CodeFixes/*Fixer.cs,tests/Moq.Analyzers.Test/*AnalyzerTests.cs,tests/Moq.Analyzers.Test/*CodeFixTests.cs} : Use [Description]Analyzer.cs, [Description]Fixer.cs, [Description]AnalyzerTests.cs, [Description]CodeFixTests.cs for new components

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: Applies to src/Analyzers/AnalyzerReleases.Unshipped.md : Update 'src/Analyzers/AnalyzerReleases.Unshipped.md' for release notes.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.111Z
Learning: If your analyzer or code fix interacts with Callback or SetupSequence, ensure you have tests for both single and sequence setups.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Applies to tests/Moq.Analyzers.Test/**/*.cs : Add or update unit tests in tests/Moq.Analyzers.Test/ for every analyzer or code fix change

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.110Z
Learning: Reference affected analyzer rule IDs in PR descriptions.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: Before working on Roslyn analyzers, you must have expert-level understanding of Roslyn syntax tree navigation, diagnostic span calculation, IOperation vs ISyntaxNode analysis, CodeFixProvider and DocumentEditor patterns, and Moq framework semantics.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.111Z
Learning: When creating a new Roslyn analyzer or code fix, locate an existing, similar component within the src/ directory and replicate its structure, dependency injection, and overall design. Prefer the IOperation-based approach where applicable.

src/Common/DiagnosticCategory.cs (10)

Learnt from: MattKotsenas
PR: #239
File: src/BannedSymbols.txt:1-8
Timestamp: 2024-10-24T21:06:43.546Z
Learning: All direct uses of Diagnostic.Create should be banned, even if DiagnosticExtensions doesn't currently wrap them. Developers should add an extension to DiagnosticExtensions if they need to use any of the Diagnostic.Create APIs.

Learnt from: rjmurillo
PR: rjmurillo/moq.analyzers#0
File: :0-0
Timestamp: 2025-07-22T08:42:51.055Z
Learning: For the moq.analyzers repository, diagnostic IDs follow specific ranges: Moq1000-1099 (Usage), Moq1100-1199 (Correctness), Moq1200-1299 (Correctness), Moq1300-1399 (Usage), Moq1400-1499 (Best Practice), Moq1500-1599 (Best Practice), Moq1600-1999 (Reserved). No analyzers exist above 1600.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: Applies to tests/**/*.cs : In code fix tests, the code that triggers the analyzer MUST be wrapped with the diagnostic marker syntax (e.g., {|Moq1210:...|}).

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.111Z
Learning: Always group and annotate tests by Moq version compatibility; do not include tests for features/APIs that do not exist in the targeted Moq version.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.110Z
Learning: Group test data by Moq version compatibility: 'new' for Moq 4.18.4+, 'both' or 'old' for features available in both 4.8.2 and 4.18.4.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Applies to tests/Moq.Analyzers.Test/*AnalyzerTests.cs : Use AllAnalyzersVerifier.VerifyAllAnalyzersAsync() for 'no diagnostics' tests

Learnt from: rjmurillo
PR: #633
File: src/Common/ISymbolExtensions.cs:305-305
Timestamp: 2025-07-26T22:05:51.788Z
Learning: String-based method name detection should be avoided in favor of the MoqKnownSymbols pattern for consistency, type safety, and robustness in the Moq.Analyzers codebase. Methods like IsRaisesMethodByName that use string.Equals for method name checking go against established patterns.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.111Z
Learning: If a Moq feature has known limitations or edge cases (e.g., explicit interface implementation, event setup), document this in the test or analyzer code.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.111Z
Learning: For every supported Moq feature, write tests that cover both valid and invalid usage; use Assert.Throws in tests to verify that invalid setups fail as expected.

Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Applies to {src/Analyzers/*Analyzer.cs,src/CodeFixes/*Fixer.cs,tests/Moq.Analyzers.Test/*AnalyzerTests.cs,tests/Moq.Analyzers.Test/*CodeFixTests.cs} : Use [Description]Analyzer.cs, [Description]Fixer.cs, [Description]AnalyzerTests.cs, [Description]CodeFixTests.cs for new components

🪛 LanguageTool
docs/rules/Moq1300.md

[grammar] ~8-~8: Use correct spacing
Context: ...| Severity | Error | | CodeFix | No | --- The .As() method is used when a mocked...

(QB_NEW_EN_OTHER_ERROR_IDS_5)

.github/copilot-instructions.md

[grammar] ~353-~353: There might be a mistake here.
Context: ...cause:** If a type or member is "missing", find its definition. If a configuration...

(QB_NEW_EN_OTHER)


[grammar] ~354-~354: Use correct spacing
Context: ...uidance. A wrong "fix" is worse than no action. --- ## AI Agent Troubleshooting ### Developmen...

(QB_NEW_EN_OTHER_ERROR_IDS_5)

.cursor/rules/process-task-list.md

[grammar] ~27-~27: Use prepositions correctly
Context: ...es have been committed, verify with the user the task is completed. 4. Once the us...

(QB_NEW_EN_OTHER_ERROR_IDS_7)

.cursor/rules/generate-tasks.md

[grammar] ~38-~38: There might be a mistake here.
Context: ...clude a link to the parent issue at the top, and may include its own detailed check...

(QB_NEW_EN_OTHER)


[grammar] ~38-~38: Use correct spacing
Context: ...y include its own detailed checklist if needed. #### Example Parent Issue Checklist ```markd...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~40-~40: Use correct spacing
Context: ...t if needed. #### Example Parent Issue Checklist markdown - [ ] #456 - [ ] #457 - [ ] #458 #### Example Sub-task Issue Header ```markdo...

(QB_NEW_EN_OTHER_ERROR_IDS_5)

🪛 GitHub Check: build (ubuntu-24.04-arm)
src/Analyzers/AnalyzerReleases.Unshipped.md

[failure] 20-20:
Analyzer release file 'AnalyzerReleases.Unshipped.md' has a missing or invalid release header 'Rule ID | New Category | New Severity | Notes' (https://github.com/dotnet/roslyn/blob/main/src/RoslynAnalyzers/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md)


[failure] 20-20:
Analyzer release file 'AnalyzerReleases.Unshipped.md' has a missing or invalid release header 'Rule ID | New Category | New Severity | Notes' (https://github.com/dotnet/roslyn/blob/main/src/RoslynAnalyzers/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md)

🪛 GitHub Check: build (windows-11-arm)
src/Analyzers/AnalyzerReleases.Unshipped.md

[failure] 20-20:
Analyzer release file 'AnalyzerReleases.Unshipped.md' has a missing or invalid release header 'Rule ID | New Category | New Severity | Notes' (https://github.com/dotnet/roslyn/blob/main/src/RoslynAnalyzers/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md)


[failure] 20-20:
Analyzer release file 'AnalyzerReleases.Unshipped.md' has a missing or invalid release header 'Rule ID | New Category | New Severity | Notes' (https://github.com/dotnet/roslyn/blob/main/src/RoslynAnalyzers/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md)

🪛 markdownlint-cli2 (0.17.2)
src/Analyzers/AnalyzerReleases.Unshipped.md

19-19: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


20-20: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)

🪛 GitHub Actions: Main build
src/Analyzers/AnalyzerReleases.Unshipped.md

[error] 20-20: Analyzer release file 'AnalyzerReleases.Unshipped.md' has a missing or invalid release header 'Rule ID | New Category | New Severity | Notes'.

🔇 Additional comments (17)
src/Common/DiagnosticCategory.cs (1)

8-8: LGTM - Consistent diagnostic category constant.

The new Usage constant follows the established pattern and supports the reclassification of diagnostic rules. The implementation is correct and consistent with the existing Moq constant.

.cursor/rules/generate-tasks.md (3)

36-37: LGTM - Simplified checklist format improves maintainability.

The change from hyperlinked task titles to simple issue number references (#456) makes the checklist format cleaner and easier to maintain while preserving the essential linking functionality.


43-45: Consistent format improvement.

The example parent issue checklist follows the same simplified format, maintaining consistency throughout the documentation.


72-74: Final tasks section updated consistently.

The tasks section maintains the same simplified format, completing the consistent update across all checklist examples in the document.

docs/rules/Moq1300.md (2)

5-5: Proper documentation of category change.

The addition of the "Usage" category correctly reflects the reclassification of this analyzer rule and aligns with the changes made to the analyzer implementation.


8-8: Improved consistency in documentation format.

Changing "False" to "No" provides better consistency with typical documentation formatting standards for boolean-like fields.

src/Analyzers/AnalyzerReleases.Unshipped.md (1)

19-22: Fix table header and separators in Changed Rules to match Roslyn format

The “Changed Rules” table in src/Analyzers/AnalyzerReleases.Unshipped.md uses “New Category”/“New Severity” and incorrect dash counts. According to the official Roslyn schema, it should read “Category”/“Severity” and use the standard separator lengths.

• File: src/Analyzers/AnalyzerReleases.Unshipped.md
Lines: 19–22

-### Changed Rules
-Rule ID | New Category | New Severity | Notes
---------|--------------|--------------|-------
-Moq1300 | Usage | Error | AsShouldBeUsedOnlyForInterfaceAnalyzer
+### Changed Rules
+
+Rule ID | Category | Severity | Notes
+--------|----------|----------|--------------------
+Moq1300 | Usage | Error | AsShouldBeUsedOnlyForInterfaceAnalyzer
⛔ Skipped due to learnings
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: Applies to docs/rules/**/*.md : Update 'docs/rules/' for analyzer changes.
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.110Z
Learning: Reference affected analyzer rule IDs in PR descriptions.
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Applies to {src/Analyzers/AnalyzerReleases.Unshipped.md,docs/rules/**} : Update src/Analyzers/AnalyzerReleases.Unshipped.md and add or update documentation in docs/rules/ for each diagnostic
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: Applies to src/Analyzers/AnalyzerReleases.Unshipped.md : Update 'src/Analyzers/AnalyzerReleases.Unshipped.md' for release notes.
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Applies to {docs/rules/**,README.md} : Update docs/rules/ and README.md for any analyzer, code fix, or workflow change
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.110Z
Learning: If changing an analyzer, update documentation in 'docs/rules' to reflect all changes.
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Applies to {src/Analyzers/*Analyzer.cs,src/CodeFixes/*Fixer.cs,tests/Moq.Analyzers.Test/*AnalyzerTests.cs,tests/Moq.Analyzers.Test/*CodeFixTests.cs} : Use [Description]Analyzer.cs, [Description]Fixer.cs, [Description]AnalyzerTests.cs, [Description]CodeFixTests.cs for new components
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Applies to {docs/rules/**,README.md} : Update docs/rules/ and README.md if you add or change any analyzer, code fix, or workflow
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Applies to {src/Analyzers/**/*.cs,src/CodeFixes/**/*.cs,src/Common/**/*.cs} : Place new analyzers in src/Analyzers/, code fixes in src/CodeFixes/, and shared logic in src/Common/
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.110Z
Learning: If adding an analyzer, also add a code fix, a benchmark, and documentation in 'docs/rules'.
Learnt from: rjmurillo
PR: rjmurillo/moq.analyzers#0
File: :0-0
Timestamp: 2025-07-22T08:42:51.055Z
Learning: For the moq.analyzers repository, diagnostic IDs follow specific ranges: Moq1000-1099 (Usage), Moq1100-1199 (Correctness), Moq1200-1299 (Correctness), Moq1300-1399 (Usage), Moq1400-1499 (Best Practice), Moq1500-1599 (Best Practice), Moq1600-1999 (Reserved). No analyzers exist above 1600.
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Note Moq version compatibility for analyzer/test changes
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Applies to tests/Moq.Analyzers.Test/**/*.cs : Add or update unit tests in tests/Moq.Analyzers.Test/ for every analyzer or code fix change
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: Applies to tests/**/*.cs : In code fix tests, the code that triggers the analyzer MUST be wrapped with the diagnostic marker syntax (e.g., {|Moq1210:...|}).
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.111Z
Learning: Avoid unnecessary complexity in test types and mock setups; each test should demonstrate a single Moq feature or analyzer rule.
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: Applies to tests/Moq.Analyzers.Benchmarks/**/*.cs : Performance-sensitive changes require benchmark validation. Run performance tests locally before submitting PRs and include performance regression analysis in PR description.
Learnt from: rjmurillo
PR: rjmurillo/moq.analyzers#0
File: :0-0
Timestamp: 2025-07-22T17:25:24.857Z
Learning: Applies to {src/Analyzers/**/*.cs,tests/**/*.cs}: Moq protected member APIs that need analyzer validation include: Setup, SetupSequence, SetupGet<T>, SetupSet<T>, Verify, VerifyGet<T>, VerifySet<T>, and As<T>() for interface mapping. All protected members must be virtual or abstract to be mockable.
Learnt from: rjmurillo
PR: rjmurillo/moq.analyzers#0
File: :0-0
Timestamp: 2025-07-22T17:25:24.857Z
Learning: Applies to {src/Analyzers/**/*.cs,tests/**/*.cs}: Moq protected member APIs that need analyzer validation include: Setup, SetupSequence, SetupGet<T>, SetupSet<T>, Verify, VerifyGet<T>, VerifySet<T>, and As<T>() for interface mapping. All protected members must be virtual or abstract to be mockable.
src/Analyzers/AsShouldBeUsedOnlyForInterfaceAnalyzer.cs (6)

12-12: Excellent improvement to diagnostic message clarity.

The parameterized message format now includes the actual type name, making the diagnostic much more informative for developers. This is a significant improvement over the generic message.


13-14: Good addition of detailed description.

The description provides clear context about when and why the As<T>() method should be used, improving the developer experience with better documentation.


20-20: Proper category reclassification.

The change from hardcoded "Moq" to DiagnosticCategory.Usage correctly implements the reclassification goal of this PR and follows the established pattern for diagnostic categories.


23-23: Consistent addition of description parameter.

Adding the description parameter to the diagnostic descriptor ensures the detailed description is properly associated with the rule.


82-83: Improved code clarity with explicit variable assignment.

Extracting the type argument to a local variable before the interface check improves readability and makes the subsequent diagnostic reporting cleaner.


93-93: Proper implementation of parameterized diagnostic reporting.

The diagnostic now correctly passes the type name as an argument, enabling the informative message format. This completes the improvement cycle from message definition to reporting.

.github/copilot-instructions.md (2)

383-384: ✅ Verified: No changes to AnalyzerReleases.Shipped.md
This PR complies with our policy—AnalyzerReleases.Shipped.md remains untouched.


350-355: Minor spacing / grammar nitpick

There are two consecutive spaces before the horizontal rule and the dash in “workarounds”. Tighten spacing and wording for clarity.

-  - **Do not apply workarounds:** Never change the code to simply make an error go away (...)
+  - **Do not apply work-arounds:** Never change the code simply to silence an error (...)
⛔ Skipped due to learnings
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: Applies to **/CONTRIBUTING.md : Update contributing guidelines for workflow changes.
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .cursor/rules/conventional-commit-messages.mdc:0-0
Timestamp: 2025-06-25T12:42:55.421Z
Learning: A description must immediately follow the colon and space after the type/scope prefix, and should be a short summary of the code changes.
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .cursor/rules/conventional-commit-messages.mdc:0-0
Timestamp: 2025-06-25T12:42:54.674Z
Learning: The description in the commit message must immediately follow the colon and space after the type/scope prefix and should be a short summary of the code changes.
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.111Z
Learning: Do not 'fix' a failing test by adjusting code and re-running; fixes must come from a deliberate, correct understanding of the syntax tree.
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.111Z
Learning: Always check for and follow any new rules in .cursor/rules/, .editorconfig, and .github/copilot-instructions.md before making changes.
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Applies to {docs/rules/**,README.md} : Update docs/rules/ and README.md for any analyzer, code fix, or workflow change
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .cursor/rules/conventional-commit-messages.mdc:0-0
Timestamp: 2025-06-25T12:42:54.674Z
Learning: A scope in the commit message is optional and, if present, must be a noun describing a section of the codebase, enclosed in parentheses after the type (e.g., fix(parser):).
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Run dotnet build (no warnings allowed)
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: Applies to **/*.{cs,csproj,sln} : Build with 'dotnet build /p:PedanticMode=true'. All warnings must be treated as errors. PRs that do not build cleanly will be closed.
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.110Z
Learning: If a step can fail, code the failure path first and make it obvious (e.g., throw new ArgumentNullException, Debug.Assert, Contract.Requires, Assert.Throws in tests).
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.111Z
Learning: If you cannot truthfully declare expert-level Roslyn knowledge, you must stop and request guidance.
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: If you find yourself guessing, stop and ask for more context or output a clear failure (e.g., throw new NotImplementedException("Unclear requirement: ..."))
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Run dotnet test (all must pass)
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: Applies to tests/**/*.cs : Run all unit tests using 'dotnet test --settings ./build/targets/tests/test.runsettings'. All tests must pass.
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: Applies to src/**/*.cs : All diagnostic spans in Roslyn analyzers MUST be character-precise. A test failure related to a diagnostic span is a CRITICAL FAILURE and must be addressed immediately.
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.110Z
Learning: Build with warnings as errors using 'dotnet build /p:PedanticMode=true'.
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .cursor/rules/csharp.mdc:0-0
Timestamp: 2025-07-19T08:09:48.255Z
Learning: Applies to *.{cs,csproj,sln} : Always read and apply the instructions in [copilot-instructions.md](mdc:.github/copilot-instructions.md) when working on C# source or project files
.cursor/rules/process-task-list.md (2)

8-10: New “load rules” & “STOP on build/test failure” bullets look solid

Explicitly loading instruction files and treating build/test failures as hard stops aligns with the repo’s stricter standards. No issues spotted.


24-25: Commit-message example exceeds 50-character first line

The sample first -m segment is 32 chars (“feat: add payment validation logic”)—fine—but the chained -m flags make the example hard to read. Consider shortening or line-wrapping within docs, though this is non-blocking.

⛔ Skipped due to learnings
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.110Z
Learning: Each commit must focus on a single, self-contained change ('one idea, one commit') and keep commit messages under 50 characters when possible.
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .cursor/rules/conventional-commit-messages.mdc:0-0
Timestamp: 2025-07-19T08:09:45.503Z
Learning: A longer commit body MAY be provided after the short description, beginning one blank line after the description
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.111Z
Learning: Commit messages: capitalize the first word, do not end in punctuation, use imperative mood, keep the first line under 50 characters, and be direct and informative.
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .cursor/rules/conventional-commit-messages.mdc:0-0
Timestamp: 2025-06-25T12:42:55.421Z
Learning: A longer commit body may be provided after the description, starting one blank line after the description, and may consist of any number of newline separated paragraphs.
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .cursor/rules/conventional-commit-messages.mdc:0-0
Timestamp: 2025-07-19T08:09:45.503Z
Learning: Types other than feat and fix MAY be used in your commit messages, e.g., docs: update ref docs
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .cursor/rules/conventional-commit-messages.mdc:0-0
Timestamp: 2025-06-25T12:42:54.674Z
Learning: The commit body, if present, must begin one blank line after the description and may contain any number of newline-separated paragraphs.
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .cursor/rules/conventional-commit-messages.mdc:0-0
Timestamp: 2025-06-25T12:42:55.421Z
Learning: Types other than feat and fix may be used in commit messages, such as build, chore, ci, docs, style, refactor, perf, and test, but only feat, fix, and breaking changes have implicit effects on Semantic Versioning.
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .cursor/rules/conventional-commit-messages.mdc:0-0
Timestamp: 2025-06-25T12:42:54.674Z
Learning: Types other than 'feat' and 'fix' (such as build, chore, ci, docs, style, refactor, perf, test) may be used in commit messages, but only 'feat', 'fix', and breaking changes have implicit effects on Semantic Versioning.
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .cursor/rules/conventional-commit-messages.mdc:0-0
Timestamp: 2025-07-19T08:09:45.503Z
Learning: Commits MUST be prefixed with a type (e.g., feat, fix), followed by an optional scope, optional !, and a required colon and space
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .cursor/rules/conventional-commit-messages.mdc:0-0
Timestamp: 2025-06-25T12:42:54.674Z
Learning: The commit type 'feat' must be used when adding a new feature, and 'fix' must be used for bug fixes, aligning with Semantic Versioning (MINOR and PATCH, respectively).
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .cursor/rules/conventional-commit-messages.mdc:0-0
Timestamp: 2025-06-25T12:42:55.421Z
Learning: The type 'feat' must be used when a commit adds a new feature to the application or library, and 'fix' must be used for bug fixes.
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .cursor/rules/conventional-commit-messages.mdc:0-0
Timestamp: 2025-07-19T08:09:45.503Z
Learning: The type feat MUST be used when a commit adds a new feature to your application or library
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-07-27T02:45:02.136Z
Learning: Follow the Conventional Commits specification for commit messages: <type>[optional scope]: <description>.
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-25T12:42:47.111Z
Learning: Keep commit messages short and in the imperative mood; confirm a clean working tree with git status before committing.
Learnt from: CR
PR: rjmurillo/moq.analyzers#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-27T02:44:39.596Z
Learning: Ensure all changes are covered by tests and documentation before committing

Comment on lines +27 to 33
3. Once all the subtasks are marked completed and changes have been committed, verify with the user the task is completed.
4. Once the user has indicated the work is verified, push the branch and open a pull request.
- **Title**: Uses convention commit format
- **Body**: Be descriptive
- **Explain**: all changes made, why they were made, and all validation performed
- **Reference the Task** Use language to indicate the issue is resolved at the end of the description (e.g., `Fixes #456`, `Closes #123`, `Resolves #789` etc. )
- Stop after each sub‑task and wait for the user's go‑ahead.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Grammar & wording tweaks for clarity

-  3. Once all the subtasks are marked completed and changes have been committed, verify with the user the task is completed.
+  3. After all subtasks are completed and committed, verify with the user that the task is finished.
@@
-    - **Title**: Uses convention commit format
+    - **Title**: Use conventional commit format
@@
-      - **Reference the Task** Use language to indicate the issue is resolved at the end of the description (e.g., `Fixes #456`, `Closes #123`, `Resolves #789` etc. )
+      - **Reference the task:** Indicate resolution at the end of the description (e.g., `Fixes #456`, `Closes #123`, `Resolves #789`).

These small edits improve readability without changing intent.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
3. Once all the subtasks are marked completed and changes have been committed, verify with the user the task is completed.
4. Once the user has indicated the work is verified, push the branch and open a pull request.
- **Title**: Uses convention commit format
- **Body**: Be descriptive
- **Explain**: all changes made, why they were made, and all validation performed
- **Reference the Task** Use language to indicate the issue is resolved at the end of the description (e.g., `Fixes #456`, `Closes #123`, `Resolves #789` etc. )
- Stop after each subtask and wait for the user's goahead.
3. After all subtasks are completed and committed, verify with the user that the task is finished.
4. Once the user has indicated the work is verified, push the branch and open a pull request.
- **Title**: Use conventional commit format
- **Body**: Be descriptive
- **Explain**: all changes made, why they were made, and all validation performed
- **Reference the task:** Indicate resolution at the end of the description (e.g., `Fixes #456`, `Closes #123`, `Resolves #789`).
- Stop after each sub-task and wait for the user's go-ahead.
🧰 Tools
🪛 LanguageTool

[grammar] ~27-~27: Use prepositions correctly
Context: ...es have been committed, verify with the user the task is completed. 4. Once the us...

(QB_NEW_EN_OTHER_ERROR_IDS_7)

🤖 Prompt for AI Agents
In .cursor/rules/process-task-list.md around lines 27 to 33, improve grammar and
wording for clarity by rephrasing sentences to enhance readability without
altering the original meaning. Adjust punctuation and phrasing to make
instructions clearer and more concise, ensuring the steps flow logically and are
easy to understand.

Comment on lines +350 to +355
- **Handle Build Failures Correctly:** If a `dotnet build` command fails, you **MUST** treat it as a critical stop condition.
- **Analyze the error:** Do not guess. Read the build output carefully to understand the exact cause.
- **Do not apply workarounds:** Never change the code to simply make an error go away (e.g., changing a required value to a different, incorrect one that happens to exist).
- **Investigate the root cause:** If a type or member is "missing", find its definition. If a configuration is wrong, find the configuration file.
- **Escalate if unsure:** If you cannot determine the root cause after investigation, you **MUST STOP** and ask for guidance. A wrong "fix" is worse than no action.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Consider consolidating build-failure stop rules to avoid duplication

A very similar “stop on build/test failure” directive already exists earlier (lines 54-60 “Critical Failure Recognition”). Keeping two copies risks divergence. Move the new bullet under that existing section or reference it from here to avoid future drift.

🧰 Tools
🪛 LanguageTool

[grammar] ~353-~353: There might be a mistake here.
Context: ...cause:** If a type or member is "missing", find its definition. If a configuration...

(QB_NEW_EN_OTHER)


[grammar] ~354-~354: Use correct spacing
Context: ...uidance. A wrong "fix" is worse than no action. --- ## AI Agent Troubleshooting ### Developmen...

(QB_NEW_EN_OTHER_ERROR_IDS_5)

🤖 Prompt for AI Agents
In .github/copilot-instructions.md around lines 350 to 355, the build failure
handling rules are duplicated from an earlier section (lines 54-60). To fix
this, consolidate the new bullet points by either moving them under the existing
"Critical Failure Recognition" section or referencing that section here,
ensuring there is only one authoritative set of rules to prevent divergence.

- Added Moq1300 to the list of new rules with its category and severity.
- Removed the section for changed rules as it is no longer applicable.

This update ensures the documentation accurately reflects the current state of analyzer rules.
- Added Moq1300 to the list of new rules with its category and severity.
- Removed the section for changed rules as it is no longer applicable.

This update ensures the documentation accurately reflects the current state of analyzer rules.
@rjmurillo rjmurillo closed this Jul 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update Metadata for AsShouldBeUsedOnlyForInterfaceAnalyzer

1 participant