Add rule to explicitly pick MockBehavior#226
Conversation
📝 Walkthrough📝 WalkthroughWalkthroughThe changes in this pull request introduce a new analyzer rule, Changes
Assessment against linked issues
Possibly related PRs
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 15
🧹 Outside diff range comments (2)
src/Moq.Analyzers/Common/DiagnosticIds.cs (1)
Line range hint
3-3: Consider evaluating the use ofreadonlyinstead ofconst.The pragma directive
#pragma warning disable ECS0200suggests that there might be a reason to usereadonlyinstead ofconstfor flexibility. Whileconstis appropriate for compile-time constants,readonlyallows for runtime initialization and can be more flexible in certain scenarios.Consider evaluating if
readonlywould be more appropriate for these diagnostic IDs, especially if there's a possibility that these values might need to be changed at runtime or loaded from a configuration in the future.src/Moq.Analyzers/Common/ISymbolExtensions.cs (1)
Line range hint
68-75: Suggestion: OptimizeIsMethodReturnTypeTaskmethodWhile not directly related to the changes in this PR, the
IsMethodReturnTypeTaskmethod uses string comparisons, which might not be the most efficient approach.Consider refactoring this method to use symbol comparisons instead of string comparisons. This could improve performance, especially for large codebases. Here's a potential implementation:
public static bool IsMethodReturnTypeTask(this ISymbol methodSymbol) { if (methodSymbol is not IMethodSymbol method) return false; var returnType = method.ReturnType; if (returnType.ContainingNamespace?.ToDisplayString() != "System.Threading.Tasks") return false; return returnType.Name switch { "Task" => true, "ValueTask" => true, _ => returnType is INamedTypeSymbol { IsGenericType: true } namedType && (namedType.ConstructedFrom.Name == "Task" || namedType.ConstructedFrom.Name == "ValueTask") }; }This approach uses symbol information directly, avoiding string allocations and comparisons.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
📒 Files selected for processing (8)
- docs/rules/Moq1400.md (1 hunks)
- src/Moq.Analyzers/AnalyzerReleases.Unshipped.md (1 hunks)
- src/Moq.Analyzers/AsShouldBeUsedOnlyForInterfaceAnalyzer.cs (0 hunks)
- src/Moq.Analyzers/Common/DiagnosticIds.cs (1 hunks)
- src/Moq.Analyzers/Common/ISymbolExtensions.cs (2 hunks)
- src/Moq.Analyzers/SetExplicitMockBehaviorAnalyzer.cs (1 hunks)
- tests/Moq.Analyzers.Test/Helpers/ReferenceAssemblyCatalog.cs (1 hunks)
- tests/Moq.Analyzers.Test/SetExplictMockBehaviorAnalyzerTests.cs (1 hunks)
💤 Files with no reviewable changes (1)
- src/Moq.Analyzers/AsShouldBeUsedOnlyForInterfaceAnalyzer.cs
🧰 Additional context used
📓 Path-based instructions (6)
docs/rules/Moq1400.md (1)
Pattern
docs/rules/**/*.md: Evaluate the markdown files against the standards for Roslyn Code Analysis rulessrc/Moq.Analyzers/Common/DiagnosticIds.cs (1)
Pattern
**/*.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:
- Review the code carefully and systematically
- Trace the relevant code paths
- Consider boundary conditions and potential error states
- Look for antipatterns that tend to cause bugs
- Run the code mentally with example inputs
- Think about interactions between components
When you find potential bugs, for each one provide:
- File path and line number(s)
- Description of the issue and why it's a bug
- Example input that would trigger the bug
- 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.
src/Moq.Analyzers/Common/ISymbolExtensions.cs (1)
Pattern
**/*.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:
- Review the code carefully and systematically
- Trace the relevant code paths
- Consider boundary conditions and potential error states
- Look for antipatterns that tend to cause bugs
- Run the code mentally with example inputs
- Think about interactions between components
When you find potential bugs, for each one provide:
- File path and line number(s)
- Description of the issue and why it's a bug
- Example input that would trigger the bug
- 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.
src/Moq.Analyzers/SetExplicitMockBehaviorAnalyzer.cs (1)
Pattern
**/*.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:
- Review the code carefully and systematically
- Trace the relevant code paths
- Consider boundary conditions and potential error states
- Look for antipatterns that tend to cause bugs
- Run the code mentally with example inputs
- Think about interactions between components
When you find potential bugs, for each one provide:
- File path and line number(s)
- Description of the issue and why it's a bug
- Example input that would trigger the bug
- 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.
tests/Moq.Analyzers.Test/Helpers/ReferenceAssemblyCatalog.cs (1)
Pattern
**/*.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:
- Review the code carefully and systematically
- Trace the relevant code paths
- Consider boundary conditions and potential error states
- Look for antipatterns that tend to cause bugs
- Run the code mentally with example inputs
- Think about interactions between components
When you find potential bugs, for each one provide:
- File path and line number(s)
- Description of the issue and why it's a bug
- Example input that would trigger the bug
- 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.
tests/Moq.Analyzers.Test/SetExplictMockBehaviorAnalyzerTests.cs (1)
Pattern
**/*.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:
- Review the code carefully and systematically
- Trace the relevant code paths
- Consider boundary conditions and potential error states
- Look for antipatterns that tend to cause bugs
- Run the code mentally with example inputs
- Think about interactions between components
When you find potential bugs, for each one provide:
- File path and line number(s)
- Description of the issue and why it's a bug
- Example input that would trigger the bug
- 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.
🪛 Markdownlint
docs/rules/Moq1400.md
14-14: Expected: 1; Actual: 2
Multiple consecutive blank lines(MD012, no-multiple-blanks)
src/Moq.Analyzers/AnalyzerReleases.Unshipped.md
8-8: null
Files should end with a single newline character(MD047, single-trailing-newline)
🪛 GitHub Check: Codacy Static Code Analysis
docs/rules/Moq1400.md
[notice] 14-14: docs/rules/Moq1400.md#L14
Expected: 1; Actual: 2src/Moq.Analyzers/SetExplicitMockBehaviorAnalyzer.cs
[failure] 1-1: src/Moq.Analyzers/SetExplicitMockBehaviorAnalyzer.cs#L1
Provide an 'AssemblyVersion' attribute for assembly 'srcassembly.dll'.tests/Moq.Analyzers.Test/SetExplictMockBehaviorAnalyzerTests.cs
[failure] 1-1: tests/Moq.Analyzers.Test/SetExplictMockBehaviorAnalyzerTests.cs#L1
Provide an 'AssemblyVersion' attribute for assembly 'srcassembly.dll'.
🔇 Additional comments (8)
src/Moq.Analyzers/AnalyzerReleases.Unshipped.md (2)
1-5: LGTM: File header and section introduction are well-structured.The file header clearly explains the purpose of the document, and the "New Rules" section is properly introduced. This structure aids in readability and follows good documentation practices.
🧰 Tools
🪛 LanguageTool
[uncategorized] ~1-~1: Loose punctuation mark.
Context: ; Unshipped analyzer release ; https://gi...(UNLIKELY_OPENING_PUNCTUATION)
🪛 Markdownlint
2-2: null
Bare URL used(MD034, no-bare-urls)
1-1: null
First line in a file should be a top-level heading(MD041, first-line-heading, first-line-h1)
6-8: LGTM: New ruleMoq1400is well-documented.The rule documentation provides all necessary information in a clear, tabular format. The inclusion of a link to the full documentation is particularly helpful for users.
Please verify that the documentation link is correct and accessible:
✅ Verification successful
Verification Successful: Documentation link is correct and accessible.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the documentation link for Moq1400 # Test: Check if the documentation file exists if fd -p "docs/rules/Moq1400.md"; then echo "Documentation file found." else echo "Documentation file not found. Please ensure it exists at the specified path." fi # Test: Verify the content of the documentation file if fd -p "docs/rules/Moq1400.md" -x cat; then echo "Documentation file content retrieved successfully." else echo "Failed to retrieve documentation file content. Please check file permissions and content." fiLength of output: 1547
🧰 Tools
🪛 Markdownlint
8-8: null
Files should end with a single newline character(MD047, single-trailing-newline)
src/Moq.Analyzers/Common/DiagnosticIds.cs (1)
15-15: LGTM: New constant follows existing conventions and aligns with PR objectives.The new constant
SetExplicitMockBehaviorwith the value "Moq1400" follows the existing naming convention and value pattern. This addition aligns well with the PR objectives of introducing a new rule for explicitly choosing mocking behavior.docs/rules/Moq1400.md (1)
1-8: LGTM: Rule header and metadata are well-defined.The rule title clearly describes the purpose, and the metadata table provides essential information about the rule. The warning severity aligns with the PR objectives.
tests/Moq.Analyzers.Test/Helpers/ReferenceAssemblyCatalog.cs (1)
Line range hint
22-29: Consider potential issues with using different Moq versionsWhile the use of different Moq versions (4.8.2 and 4.18.4) for testing purposes is understandable, it's important to be aware of potential issues that may arise:
- Inconsistent behavior: Different versions may have slight variations in behavior, which could lead to inconsistent test results.
- Maintenance overhead: Keeping track of multiple versions and their specific features/bugs may increase maintenance complexity.
- Dependency conflicts: In more complex scenarios, having multiple versions could potentially lead to dependency conflicts.
To ensure that using different versions doesn't introduce unexpected issues, consider running the following verification:
This script will help identify any code that might be sensitive to Moq version differences, allowing you to verify that the use of different versions is intentional and properly handled throughout the codebase.
✅ Verification successful
Verified: Different Moq versions are appropriately managed and do not introduce inconsistencies or conflicts.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for any inconsistencies or issues related to using different Moq versions # Test: Search for usage of Moq-specific features that might differ between versions rg --type csharp -i '(mock|moq).*\.(setup|verify|of|behavior)' # Test: Check for any explicit version checks or conditionals related to Moq versions rg --type csharp -i '(moq.*version|#if.*moq)'Length of output: 24103
tests/Moq.Analyzers.Test/SetExplictMockBehaviorAnalyzerTests.cs (2)
7-33: LGTM: Comprehensive test data generationThe
TestData()method provides a good coverage of different mock creation scenarios, including cases where theMoq1400diagnostic should be triggered. The use of extension methods for adding namespaces and reference assembly groups is a nice touch for maintaining clean and reusable test code.
1-58: Summary: Good test implementation with minor typo fixes neededOverall, this test file provides a comprehensive set of test cases for the
SetExplicitMockBehaviorAnalyzer. The implementation is well-structured and should effectively verify the analyzer's behavior across different scenarios.Key points:
- The
TestData()method generates a good variety of test cases.- The test method uses theory and member data appropriately for parameterized testing.
- The generated code snippets provide proper context for testing the analyzer.
The only issues found were typos in the class and method names ("Explict" instead of "Explicit"), which have been addressed in previous comments. Once these are fixed, the file will be in excellent shape.
🧰 Tools
🪛 GitHub Check: Codacy Static Code Analysis
[failure] 1-1: tests/Moq.Analyzers.Test/SetExplictMockBehaviorAnalyzerTests.cs#L1
Provide an 'AssemblyVersion' attribute for assembly 'srcassembly.dll'.src/Moq.Analyzers/Common/ISymbolExtensions.cs (1)
18-23: LGTM: Documentation enhancementThe added examples in the XML documentation provide clear and relevant use cases for the
IsInstanceOfmethod. This improvement helps developers better understand how the method behaves with generic methods and types.
There was a problem hiding this comment.
Actionable comments posted: 15
🧹 Outside diff range comments (2)
src/Moq.Analyzers/Common/DiagnosticIds.cs (1)
Line range hint
3-3: Consider usingreadonlyinstead ofconstfor flexibilityThe pragma directive
#pragma warning disable ECS0200suggests that usingconstinstead ofreadonlymight reduce flexibility. Consider changing the constants toreadonlyfields if runtime flexibility is needed. This would allow the values to be determined at runtime if necessary, while still preventing modification after initialization.Example:
internal static class DiagnosticIds { internal static readonly string SealedClassCannotBeMocked = "Moq1000"; // ... other fields ... }This change would make the code more flexible without significantly impacting performance in most cases.
tests/Moq.Analyzers.Test/Helpers/ReferenceAssemblyCatalog.cs (1)
Line range hint
1-31: Consider improving error handling and version management.While the existing code appears to be functioning correctly, there are a couple of areas where it could be enhanced:
Error Handling: Consider adding explicit error handling for package resolution failures. This could help diagnose issues if the required Moq versions become unavailable or if there are network problems during test execution.
Version Management: The code currently hardcodes specific Moq versions. To improve maintainability, consider extracting these version numbers into constants or configuration values. This would make it easier to update versions in the future without modifying the code.
Here's a suggestion for implementing these improvements:
internal static class ReferenceAssemblyCatalog { private const string OldMoqVersion = "4.8.2"; private const string NewMoqVersion = "4.18.4"; public static string Net80WithOldMoq => nameof(Net80WithOldMoq); public static string Net80WithNewMoq => nameof(Net80WithNewMoq); public static IReadOnlyDictionary<string, ReferenceAssemblies> Catalog { get; } static ReferenceAssemblyCatalog() { try { Catalog = new Dictionary<string, ReferenceAssemblies>(StringComparer.Ordinal) { { nameof(Net80WithOldMoq), ReferenceAssemblies.Net.Net80.AddPackages([new PackageIdentity("Moq", OldMoqVersion)]) }, { nameof(Net80WithNewMoq), ReferenceAssemblies.Net.Net80.AddPackages([new PackageIdentity("Moq", NewMoqVersion)]) }, }; } catch (Exception ex) { // Log the error or throw a more specific exception throw new InvalidOperationException("Failed to initialize ReferenceAssemblyCatalog. Ensure all required packages are available.", ex); } } }This refactoring extracts version numbers into constants and adds basic error handling. It also uses a static constructor to initialize the
Catalog, which allows for exception handling during initialization.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
📒 Files selected for processing (8)
- docs/rules/Moq1400.md (1 hunks)
- src/Moq.Analyzers/AnalyzerReleases.Unshipped.md (1 hunks)
- src/Moq.Analyzers/AsShouldBeUsedOnlyForInterfaceAnalyzer.cs (0 hunks)
- src/Moq.Analyzers/Common/DiagnosticIds.cs (1 hunks)
- src/Moq.Analyzers/Common/ISymbolExtensions.cs (2 hunks)
- src/Moq.Analyzers/SetExplicitMockBehaviorAnalyzer.cs (1 hunks)
- tests/Moq.Analyzers.Test/Helpers/ReferenceAssemblyCatalog.cs (1 hunks)
- tests/Moq.Analyzers.Test/SetExplictMockBehaviorAnalyzerTests.cs (1 hunks)
💤 Files with no reviewable changes (1)
- src/Moq.Analyzers/AsShouldBeUsedOnlyForInterfaceAnalyzer.cs
🧰 Additional context used
📓 Path-based instructions (6)
docs/rules/Moq1400.md (1)
Pattern
docs/rules/**/*.md: Evaluate the markdown files against the standards for Roslyn Code Analysis rulessrc/Moq.Analyzers/Common/DiagnosticIds.cs (1)
Pattern
**/*.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:
- Review the code carefully and systematically
- Trace the relevant code paths
- Consider boundary conditions and potential error states
- Look for antipatterns that tend to cause bugs
- Run the code mentally with example inputs
- Think about interactions between components
When you find potential bugs, for each one provide:
- File path and line number(s)
- Description of the issue and why it's a bug
- Example input that would trigger the bug
- 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.
src/Moq.Analyzers/Common/ISymbolExtensions.cs (1)
Pattern
**/*.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:
- Review the code carefully and systematically
- Trace the relevant code paths
- Consider boundary conditions and potential error states
- Look for antipatterns that tend to cause bugs
- Run the code mentally with example inputs
- Think about interactions between components
When you find potential bugs, for each one provide:
- File path and line number(s)
- Description of the issue and why it's a bug
- Example input that would trigger the bug
- 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.
src/Moq.Analyzers/SetExplicitMockBehaviorAnalyzer.cs (1)
Pattern
**/*.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:
- Review the code carefully and systematically
- Trace the relevant code paths
- Consider boundary conditions and potential error states
- Look for antipatterns that tend to cause bugs
- Run the code mentally with example inputs
- Think about interactions between components
When you find potential bugs, for each one provide:
- File path and line number(s)
- Description of the issue and why it's a bug
- Example input that would trigger the bug
- 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.
tests/Moq.Analyzers.Test/Helpers/ReferenceAssemblyCatalog.cs (1)
Pattern
**/*.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:
- Review the code carefully and systematically
- Trace the relevant code paths
- Consider boundary conditions and potential error states
- Look for antipatterns that tend to cause bugs
- Run the code mentally with example inputs
- Think about interactions between components
When you find potential bugs, for each one provide:
- File path and line number(s)
- Description of the issue and why it's a bug
- Example input that would trigger the bug
- 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.
tests/Moq.Analyzers.Test/SetExplictMockBehaviorAnalyzerTests.cs (1)
Pattern
**/*.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:
- Review the code carefully and systematically
- Trace the relevant code paths
- Consider boundary conditions and potential error states
- Look for antipatterns that tend to cause bugs
- Run the code mentally with example inputs
- Think about interactions between components
When you find potential bugs, for each one provide:
- File path and line number(s)
- Description of the issue and why it's a bug
- Example input that would trigger the bug
- 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.
🪛 Markdownlint
docs/rules/Moq1400.md
14-14: Expected: 1; Actual: 2
Multiple consecutive blank lines(MD012, no-multiple-blanks)
src/Moq.Analyzers/AnalyzerReleases.Unshipped.md
8-8: null
Files should end with a single newline character(MD047, single-trailing-newline)
🪛 GitHub Check: Codacy Static Code Analysis
docs/rules/Moq1400.md
[notice] 14-14: docs/rules/Moq1400.md#L14
Expected: 1; Actual: 2src/Moq.Analyzers/SetExplicitMockBehaviorAnalyzer.cs
[failure] 1-1: src/Moq.Analyzers/SetExplicitMockBehaviorAnalyzer.cs#L1
Provide an 'AssemblyVersion' attribute for assembly 'srcassembly.dll'.tests/Moq.Analyzers.Test/SetExplictMockBehaviorAnalyzerTests.cs
[failure] 1-1: tests/Moq.Analyzers.Test/SetExplictMockBehaviorAnalyzerTests.cs#L1
Provide an 'AssemblyVersion' attribute for assembly 'srcassembly.dll'.
🔇 Additional comments (9)
src/Moq.Analyzers/AnalyzerReleases.Unshipped.md (1)
1-3: LGTM: File header and documentation link.The file header clearly indicates that this is for an unshipped analyzer release, and the provided link to the documentation is helpful for understanding the purpose of this file.
🧰 Tools
🪛 LanguageTool
[uncategorized] ~1-~1: Loose punctuation mark.
Context: ; Unshipped analyzer release ; https://gi...(UNLIKELY_OPENING_PUNCTUATION)
🪛 Markdownlint
2-2: null
Bare URL used(MD034, no-bare-urls)
1-1: null
First line in a file should be a top-level heading(MD041, first-line-heading, first-line-h1)
src/Moq.Analyzers/Common/DiagnosticIds.cs (1)
15-15: LGTM: New constant follows existing conventionsThe new constant
SetExplicitMockBehavioris correctly implemented. It follows the existing naming convention and value pattern used in theDiagnosticIdsclass.docs/rules/Moq1400.md (2)
1-8: LGTM: Rule header and metadata are well-defined.The rule title clearly describes its purpose, and the metadata table provides essential information about the rule. The default enabled state and warning severity align with the PR objectives.
1-47: Overall: Well-structured and informative rule documentation.The Moq1400 rule documentation is comprehensive, clear, and aligns well with the PR objectives. It effectively communicates the purpose of the rule, provides relevant examples, and offers clear solutions. The minor suggestions provided in the review comments would further enhance the document's quality and usefulness.
Great job on creating this new rule documentation!
🧰 Tools
🪛 Markdownlint
14-14: Expected: 1; Actual: 2
Multiple consecutive blank lines(MD012, no-multiple-blanks)
🪛 GitHub Check: Codacy Static Code Analysis
[notice] 14-14: docs/rules/Moq1400.md#L14
Expected: 1; Actual: 2tests/Moq.Analyzers.Test/SetExplictMockBehaviorAnalyzerTests.cs (1)
23-23: Verify the use ofWithNewMoqReferenceAssemblyGroups()The
fluentBuildersandmockRepositoriescollections useWithNewMoqReferenceAssemblyGroups(), whilemockConstructorsusesWithMoqReferenceAssemblyGroups(). This inconsistency might lead to unexpected behavior if these methods provide different reference assemblies.Please verify if this difference is intentional. If not, consider using the same method for all collections:
- }.WithNamespaces().WithNewMoqReferenceAssemblyGroups(); + }.WithNamespaces().WithMoqReferenceAssemblyGroups();Apply this change to both lines 23 and 30 if needed.
Also applies to: 30-30
src/Moq.Analyzers/Common/ISymbolExtensions.cs (2)
18-23: LGTM: Documentation improvementThe added examples in the XML documentation provide clear illustrations of how the
IsInstanceOfmethod behaves with generic types. This improvement helps developers better understand the method's functionality.
53-53: Approved, but note the breaking changeThe change from
IEnumerable<TSymbol>toImmutableArray<TSymbol>is a good optimization for read-only scenarios. However, this is a breaking change that will affect backward compatibility.Suggestions:
- Update the method's XML documentation to reflect this change.
- Ensure this breaking change is communicated in the project's changelog or release notes.
- Consider bumping the major version number of the library to indicate a breaking change, following semantic versioning principles.
To ensure all usages of this method are updated, run the following script:
This will help identify any places in the codebase that might need updating due to this change.
✅ Verification successful
Verification Successful
No external usages of
IsInstanceOfwithIEnumerable<TSymbol>were found. The change toImmutableArray<TSymbol>is contained withinISymbolExtensions.csand does not affect other parts of the codebase.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for usages of IsInstanceOf method with IEnumerable rg --type csharp "IsInstanceOf\s*<.*?>\s*\([^)]*IEnumerable<.*?>\s*[^)]*\)"Length of output: 77
Script:
#!/bin/bash # Search for usages of IsInstanceOf method with IEnumerable<TSymbol> rg --type csharp 'IsInstanceOf\s*<\w+>\s*\(\s*IEnumerable<\w+>\s*\)'Length of output: 70
Script:
#!/bin/bash # Search for all usages of IsInstanceOf method regardless of generic parameters and argument types rg --type csharp 'IsInstanceOf\s*<.*?>\s*\('Length of output: 427
src/Moq.Analyzers/SetExplicitMockBehaviorAnalyzer.cs (2)
21-21: Verify availability of 'ThisAssembly.GitCommitId'The usage of
ThisAssembly.GitCommitIdin thehelpLinkUriassumes thatThisAssemblyandGitCommitIdare available during compilation. Please confirm that theThisAssemblyclass is generated appropriately (e.g., via a source generator likeGitInfo), and thatGitCommitIdwill be populated. Otherwise, this may result in a compilation error.
52-58: 🛠️ Refactor suggestionAvoid suppressing ECS0900 warning; refactor to minimize boxing and unboxing
The code suppresses the ECS0900 warning using
#pragma warning disableand#pragma warning restore. Instead of suppressing the warning, consider refactoring the code to eliminate boxing and unboxing operations as recommended by the warning.You can analyze the LINQ query to identify and reduce boxing/unboxing. For example, ensure that value types are not being unnecessarily boxed when selecting members.
54d745a to
1c0ade3
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
📒 Files selected for processing (1)
- docs/rules/Moq1400.md (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
docs/rules/Moq1400.md (1)
Pattern
docs/rules/**/*.md: Evaluate the markdown files against the standards for Roslyn Code Analysis rules
🔇 Additional comments (1)
docs/rules/Moq1400.md (1)
1-8: LGTM: Clear and concise rule metadata.The rule title and metadata table effectively communicate the purpose and configuration of the Moq1400 rule. The information aligns well with the PR objectives.
rjmurillo
left a comment
There was a problem hiding this comment.
Nit: Explicit is missing the first 'i'; otherwise, LGTM 👍
|
Code Climate has analyzed commit 264d108 and detected 9 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
📒 Files selected for processing (2)
- src/Moq.Analyzers/SetExplicitMockBehaviorAnalyzer.cs (1 hunks)
- tests/Moq.Analyzers.Test/SetExplictMockBehaviorAnalyzerTests.cs (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
src/Moq.Analyzers/SetExplicitMockBehaviorAnalyzer.cs (1)
Pattern
**/*.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:
- Review the code carefully and systematically
- Trace the relevant code paths
- Consider boundary conditions and potential error states
- Look for antipatterns that tend to cause bugs
- Run the code mentally with example inputs
- Think about interactions between components
When you find potential bugs, for each one provide:
- File path and line number(s)
- Description of the issue and why it's a bug
- Example input that would trigger the bug
- 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.
tests/Moq.Analyzers.Test/SetExplictMockBehaviorAnalyzerTests.cs (1)
Pattern
**/*.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:
- Review the code carefully and systematically
- Trace the relevant code paths
- Consider boundary conditions and potential error states
- Look for antipatterns that tend to cause bugs
- Run the code mentally with example inputs
- Think about interactions between components
When you find potential bugs, for each one provide:
- File path and line number(s)
- Description of the issue and why it's a bug
- Example input that would trigger the bug
- 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.
📓 Learnings (2)
src/Moq.Analyzers/SetExplicitMockBehaviorAnalyzer.cs (1)
Learnt from: MattKotsenas PR: rjmurillo/moq.analyzers#226 File: src/Moq.Analyzers/SetExplicitMockBehaviorAnalyzer.cs:45-49 Timestamp: 2024-10-15T20:25:09.079Z Learning: In this codebase, `WellKnownTypeNames` is included via global usings.tests/Moq.Analyzers.Test/SetExplictMockBehaviorAnalyzerTests.cs (1)
Learnt from: MattKotsenas PR: rjmurillo/moq.analyzers#226 File: src/Moq.Analyzers/SetExplicitMockBehaviorAnalyzer.cs:45-49 Timestamp: 2024-10-15T20:25:09.079Z Learning: In this codebase, `WellKnownTypeNames` is included via global usings.
🪛 GitHub Check: build (ubuntu-22.04)
src/Moq.Analyzers/SetExplicitMockBehaviorAnalyzer.cs
[failure] 94-94:
The name 'IsNotDefaultBehavior' does not exist in the current context
[failure] 122-122:
The name 'IsNotDefaultBehavior' does not exist in the current context
[failure] 132-132:
Remove the unused private method 'IsExplicitBehavior'. (https://rules.sonarsource.com/csharp/RSPEC-1144)
[failure] 94-94:
Consider using an alternative implementation to avoid boxing and unboxing (https://github.com/rjmurillo/EffectiveCSharp.Analyzers/blob/ffe2ef5d88a82fe95d3716b9c52562f66e31e97f/docs/rules/ECS0900.md)
[failure] 122-122:
Consider using an alternative implementation to avoid boxing and unboxing (https://github.com/rjmurillo/EffectiveCSharp.Analyzers/blob/ffe2ef5d88a82fe95d3716b9c52562f66e31e97f/docs/rules/ECS0900.md)
[failure] 94-94:
The name 'IsNotDefaultBehavior' does not exist in the current context
[failure] 122-122:
The name 'IsNotDefaultBehavior' does not exist in the current context
[failure] 132-132:
Remove the unused private method 'IsExplicitBehavior'. (https://rules.sonarsource.com/csharp/RSPEC-1144)
[failure] 94-94:
Consider using an alternative implementation to avoid boxing and unboxing (https://github.com/rjmurillo/EffectiveCSharp.Analyzers/blob/ffe2ef5d88a82fe95d3716b9c52562f66e31e97f/docs/rules/ECS0900.md)
[failure] 122-122:
Consider using an alternative implementation to avoid boxing and unboxing (https://github.com/rjmurillo/EffectiveCSharp.Analyzers/blob/ffe2ef5d88a82fe95d3716b9c52562f66e31e97f/docs/rules/ECS0900.md)
🪛 GitHub Check: build (windows-2022)
src/Moq.Analyzers/SetExplicitMockBehaviorAnalyzer.cs
[failure] 94-94:
The name 'IsNotDefaultBehavior' does not exist in the current context
[failure] 122-122:
The name 'IsNotDefaultBehavior' does not exist in the current context
[failure] 132-132:
Remove the unused private method 'IsExplicitBehavior'. (https://rules.sonarsource.com/csharp/RSPEC-1144)
[failure] 94-94:
Consider using an alternative implementation to avoid boxing and unboxing (https://github.com/rjmurillo/EffectiveCSharp.Analyzers/blob/ffe2ef5d88a82fe95d3716b9c52562f66e31e97f/docs/rules/ECS0900.md)
[failure] 122-122:
Consider using an alternative implementation to avoid boxing and unboxing (https://github.com/rjmurillo/EffectiveCSharp.Analyzers/blob/ffe2ef5d88a82fe95d3716b9c52562f66e31e97f/docs/rules/ECS0900.md)
[failure] 94-94:
The name 'IsNotDefaultBehavior' does not exist in the current context
[failure] 122-122:
The name 'IsNotDefaultBehavior' does not exist in the current context
[failure] 132-132:
Remove the unused private method 'IsExplicitBehavior'. (https://rules.sonarsource.com/csharp/RSPEC-1144)
[failure] 94-94:
Consider using an alternative implementation to avoid boxing and unboxing (https://github.com/rjmurillo/EffectiveCSharp.Analyzers/blob/ffe2ef5d88a82fe95d3716b9c52562f66e31e97f/docs/rules/ECS0900.md)
[failure] 122-122:
Consider using an alternative implementation to avoid boxing and unboxing (https://github.com/rjmurillo/EffectiveCSharp.Analyzers/blob/ffe2ef5d88a82fe95d3716b9c52562f66e31e97f/docs/rules/ECS0900.md)
🔇 Additional comments (2)
tests/Moq.Analyzers.Test/SetExplictMockBehaviorAnalyzerTests.cs (2)
5-33: Ensure comprehensive test coverage and correct test data structureThe
TestDatamethod compiles test cases for different mock creation scenarios using extension methods likeWithNamespaces()andWithMoqReferenceAssemblyGroups(). Please verify the following:
Test Data Structure: Confirm that the extension methods correctly augment each test case to provide all three parameters required by
ShouldAnalyzeMocksWithoutExplictMockBehavior:referenceAssemblyGroup,@namespace, andmock. Mismatches could lead to runtime errors or test failures.Edge Cases: Consider adding additional test cases to cover potential edge cases, such as:
- Mocks with additional arguments or configurations.
- Using
MockBehaviorspecified via variables or constants.- Scenarios involving generic type constraints or nested generics.
- Invalid or null inputs to ensure the analyzer handles exceptions gracefully.
Adding these tests will help identify any hidden issues related to edge cases or unexpected inputs.
37-57: Validate parameter alignment in the test methodThe test method
ShouldAnalyzeMocksWithoutExplictMockBehaviorexpects parameters forreferenceAssemblyGroup,@namespace, andmock. Ensure that the data provided byMemberData(nameof(TestData))aligns correctly with these parameters.
Parameter Consistency: Verify that each object array returned by
TestData()contains exactly three elements corresponding to the expected parameters. Misalignment can cause parameter binding issues during test execution.Data Integrity: Ensure that the values for
referenceAssemblyGroup,@namespace, andmockare correctly paired and represent valid combinations for testing.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
264d108 to
4f8b41f
Compare
There was a problem hiding this comment.
Actionable comments posted: 6
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
📒 Files selected for processing (2)
- src/Moq.Analyzers/SetExplicitMockBehaviorAnalyzer.cs (1 hunks)
- tests/Moq.Analyzers.Test/SetExplicitMockBehaviorAnalyzerTests.cs (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
src/Moq.Analyzers/SetExplicitMockBehaviorAnalyzer.cs (1)
Pattern
**/*.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:
- Review the code carefully and systematically
- Trace the relevant code paths
- Consider boundary conditions and potential error states
- Look for antipatterns that tend to cause bugs
- Run the code mentally with example inputs
- Think about interactions between components
When you find potential bugs, for each one provide:
- File path and line number(s)
- Description of the issue and why it's a bug
- Example input that would trigger the bug
- 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.
tests/Moq.Analyzers.Test/SetExplicitMockBehaviorAnalyzerTests.cs (1)
Pattern
**/*.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:
- Review the code carefully and systematically
- Trace the relevant code paths
- Consider boundary conditions and potential error states
- Look for antipatterns that tend to cause bugs
- Run the code mentally with example inputs
- Think about interactions between components
When you find potential bugs, for each one provide:
- File path and line number(s)
- Description of the issue and why it's a bug
- Example input that would trigger the bug
- 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.
📓 Learnings (1)
src/Moq.Analyzers/SetExplicitMockBehaviorAnalyzer.cs (1)
Learnt from: MattKotsenas PR: rjmurillo/moq.analyzers#226 File: src/Moq.Analyzers/SetExplicitMockBehaviorAnalyzer.cs:45-49 Timestamp: 2024-10-15T20:25:09.079Z Learning: In this codebase, `WellKnownTypeNames` is included via global usings.
🔇 Additional comments (11)
tests/Moq.Analyzers.Test/SetExplicitMockBehaviorAnalyzerTests.cs (4)
1-1: LGTM: Using statement is clear and concise.The alias 'Verifier' for
AnalyzerVerifier<SetExplicitMockBehaviorAnalyzer>improves code readability.
3-3: LGTM: Namespace is appropriate.The namespace
Moq.Analyzers.Testcorrectly reflects the purpose and location of these tests.
5-6: LGTM: Class declaration is clear and appropriate.The class name
SetExplicitMockBehaviorAnalyzerTestsaccurately describes its purpose, and its public accessibility is suitable for test classes.
1-58: No apparent bugs found in the test code.After careful review, no bugs related to the categories mentioned in the coding guidelines (edge cases, off-by-one errors, unexpected data types, uncaught exceptions, concurrency issues, or improper configuration settings) were found in this test file. The code is straightforward and focused on testing the analyzer's behavior with predefined inputs.
src/Moq.Analyzers/SetExplicitMockBehaviorAnalyzer.cs (7)
1-3: Global Usings Efficiently ManagedThe use of global usings effectively includes necessary namespaces, keeping the code clean and organized.
27-33: 'Initialize' Method Properly Configures the AnalyzerThe
Initializemethod correctly sets up the analysis context, enabling concurrent execution and registering the compilation start action.
35-42: 'RegisterCompilationStartAction' Method Well-StructuredThe
RegisterCompilationStartActionmethod efficiently checks for the presence of Moq references and registers operation actions accordingly.
45-49: Usage of 'WellKnownTypeNames' Is AppropriateThe retrieval of
MockBehaviorusingWellKnownTypeNamesis correctly implemented, and acknowledging the global usings avoids unnecessary imports.
132-135: 'IsExplicitBehavior' Method Accurately Identifies BehaviorsThe
IsExplicitBehaviormethod correctly checks for explicit mock behaviors "Loose" and "Strict", ensuring that the default behavior is not unintentionally used.
Line range hint
138-138: Overall Implementation Aligns with Best PracticesThe
SetExplicitMockBehaviorAnalyzeris well-implemented, adhering to Roslyn analyzer standards and effectively fulfilling the PR objectives.
79-87: Ensure 'IsInstanceOf' Extension Method Is AccessibleThe method
IsInstanceOfis used but not defined within this file. Verify that the extension method is properly imported or defined in the codebase to prevent compilation errors.Run the following script to check for the definition of
IsInstanceOf:
| foreach (IArgumentOperation argument in creationOperation.Arguments) | ||
| { | ||
| if (argument.Value is IFieldReferenceOperation fieldReferenceOperation) | ||
| { | ||
| ISymbol field = fieldReferenceOperation.Member; | ||
| if (field.ContainingType.IsInstanceOf(mockBehaviorSymbol) && IsExplicitBehavior(field.Name)) | ||
| { | ||
| return; | ||
| } | ||
| } |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Handle Explicit Behaviors Specified via Variables or Expressions
The current implementation checks for mock behaviors specified directly as field references. Consider extending the analysis to handle scenarios where the mock behavior is provided via variables, method calls, or expressions to avoid false positives.
For example, if a mock behavior is assigned to a variable and then passed as an argument, the analyzer may incorrectly report a diagnostic. Enhancing the logic to perform a more comprehensive analysis of the argument values can improve accuracy.
| foreach (IArgumentOperation argument in invocationOperation.Arguments) | ||
| { | ||
| if (argument.Value is IFieldReferenceOperation fieldReferenceOperation) | ||
| { | ||
| ISymbol field = fieldReferenceOperation.Member; | ||
| if (field.ContainingType.IsInstanceOf(mockBehaviorSymbol) && IsExplicitBehavior(field.Name)) | ||
| { | ||
| return; | ||
| } | ||
| } |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Unified Argument Analysis across Methods
The argument analysis logic in AnalyzeInvocation mirrors that in AnalyzeNewObject. Consider refactoring this repetitive code into a shared method to enhance maintainability and reduce duplication.
Extract the argument analysis into a helper method:
private static bool HasExplicitBehavior(ImmutableArray<IArgumentOperation> arguments, INamedTypeSymbol mockBehaviorSymbol)
{
foreach (IArgumentOperation argument in arguments)
{
if (argument.Value is IFieldReferenceOperation fieldReferenceOperation)
{
ISymbol field = fieldReferenceOperation.Member;
if (field.ContainingType.IsInstanceOf(mockBehaviorSymbol) && IsExplicitBehavior(field.Name))
{
return true;
}
}
}
return false;
}Then update the methods:
// In AnalyzeNewObject
-if (/* argument analysis logic */)
+if (HasExplicitBehavior(creationOperation.Arguments, mockBehaviorSymbol))
// In AnalyzeInvocation
-if (/* argument analysis logic */)
+if (HasExplicitBehavior(invocationOperation.Arguments, mockBehaviorSymbol))| } | ||
| } | ||
|
|
||
| context.ReportDiagnostic(creationOperation.Syntax.GetLocation().CreateDiagnostic(Rule)); |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Provide More Specific Diagnostic Location
When reporting the diagnostic, consider pinpointing the location of the default mock behavior argument rather than the entire object creation syntax. This will help developers identify the exact issue more efficiently.
Apply this diff to report the diagnostic at the specific argument location:
-context.ReportDiagnostic(creationOperation.Syntax.GetLocation().CreateDiagnostic(Rule));
+if (creationOperation.Arguments.Length > 0)
+{
+ context.ReportDiagnostic(creationOperation.Arguments[0].Syntax.GetLocation().CreateDiagnostic(Rule));
+}
+else
+{
+ context.ReportDiagnostic(creationOperation.Syntax.GetLocation().CreateDiagnostic(Rule));
+}📝 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.
| context.ReportDiagnostic(creationOperation.Syntax.GetLocation().CreateDiagnostic(Rule)); | |
| if (creationOperation.Arguments.Length > 0) | |
| { | |
| context.ReportDiagnostic(creationOperation.Arguments[0].Syntax.GetLocation().CreateDiagnostic(Rule)); | |
| } | |
| else | |
| { | |
| context.ReportDiagnostic(creationOperation.Syntax.GetLocation().CreateDiagnostic(Rule)); | |
| } |
| #pragma warning disable ECS0900 // Minimize boxing and unboxing | ||
| ImmutableArray<IMethodSymbol> ofMethods = mockTypes | ||
| .SelectMany(mockType => mockType.GetMembers(WellKnownTypeNames.Of)) | ||
| .OfType<IMethodSymbol>() | ||
| .Where(method => method.IsGenericMethod) | ||
| .ToImmutableArray(); | ||
| #pragma warning restore ECS0900 // Minimize boxing and unboxing |
There was a problem hiding this comment.
🧹 Nitpick (assertive)
Clarify Suppression of 'ECS0900' Warning
The suppression of the ECS0900 warning for minimizing boxing and unboxing is noted. Consider providing a comment explaining why this suppression is necessary to aid future maintainability.
Apply this diff to add an explanatory comment:
#pragma warning disable ECS0900 // Minimize boxing and unboxing
+// Suppressing this warning because the LINQ query does not significantly impact performance in this context.
ImmutableArray<IMethodSymbol> ofMethods = mockTypes📝 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.
| #pragma warning disable ECS0900 // Minimize boxing and unboxing | |
| ImmutableArray<IMethodSymbol> ofMethods = mockTypes | |
| .SelectMany(mockType => mockType.GetMembers(WellKnownTypeNames.Of)) | |
| .OfType<IMethodSymbol>() | |
| .Where(method => method.IsGenericMethod) | |
| .ToImmutableArray(); | |
| #pragma warning restore ECS0900 // Minimize boxing and unboxing | |
| #pragma warning disable ECS0900 // Minimize boxing and unboxing | |
| // Suppressing this warning because the LINQ query does not significantly impact performance in this context. | |
| ImmutableArray<IMethodSymbol> ofMethods = mockTypes | |
| .SelectMany(mockType => mockType.GetMembers(WellKnownTypeNames.Of)) | |
| .OfType<IMethodSymbol>() | |
| .Where(method => method.IsGenericMethod) | |
| .ToImmutableArray(); | |
| #pragma warning restore ECS0900 // Minimize boxing and unboxing |
[//]: # (dependabot-start)
⚠️ **Dependabot is rebasing this PR** ⚠️
Rebasing might not happen immediately, so don't worry if this takes some
time.
Note: if you make any changes to this PR yourself, they will take
precedence over the rebase.
---
[//]: # (dependabot-end)
Updated
[Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer)
from 2.0.182 to 2.0.276.
<details>
<summary>Release notes</summary>
_Sourced from [Meziantou.Analyzer's
releases](https://github.com/meziantou/Meziantou.Analyzer/releases)._
## 2.0.276
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.276>
## What's Changed
* Fix MA0182 false positive on types with DynamicallyAccessedMembers
attribute by @Copilot in
https://github.com/meziantou/Meziantou.Analyzer/pull/963
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.275...2.0.276
## 2.0.275
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.275>
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.274...2.0.275
## 2.0.274
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.274>
## What's Changed
* Fix MA0182 to handle COM interop types with CoClass attribute by
@Copilot in https://github.com/meziantou/Meziantou.Analyzer/pull/959
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.273...2.0.274
## 2.0.273
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.273>
## What's Changed
* Fix MA0182 false positive for pointer type parameters by @Copilot in
https://github.com/meziantou/Meziantou.Analyzer/pull/961
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.272...2.0.273
## 2.0.272
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.272>
## What's Changed
* Extend MA0182 to all types by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/957
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.271...2.0.272
## 2.0.271
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.271>
## What's Changed
* Add MA0182: Detect unused internal classes with correct handling of
generic type arguments and typeof references by @Copilot in
https://github.com/meziantou/Meziantou.Analyzer/pull/956
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.270...2.0.271
## 2.0.270
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.270>
## What's Changed
* Apply repository configuration by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/954
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.269...2.0.270
## 2.0.269
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.269>
## What's Changed
* Apply repository configuration by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/953
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.268...2.0.269
## 2.0.268
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.268>
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.267...2.0.268
## 2.0.267
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.267>
## What's Changed
* Add MA0181 - Report use of explicit casts by @Copilot in
https://github.com/meziantou/Meziantou.Analyzer/pull/952
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.266...2.0.267
## 2.0.266
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.266>
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.265...2.0.266
## 2.0.265
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.265>
## What's Changed
* Add refactoring: convert interpolated string to Format call by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/948
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.264...2.0.265
## 2.0.264
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.264>
## What's Changed
* Lower global_level from -1 to -100 in editorconfig files by @Copilot
in https://github.com/meziantou/Meziantou.Analyzer/pull/944
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.263...2.0.264
## 2.0.263
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.263>
## What's Changed
* Add MA0180: Detect ILogger<T> type parameter mismatch with containing
class by @Copilot in
https://github.com/meziantou/Meziantou.Analyzer/pull/941
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.262...2.0.263
## 2.0.262
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.262>
## What's Changed
* Make DocumentationGenerator ignore trailing whitespace differences by
@Copilot in https://github.com/meziantou/Meziantou.Analyzer/pull/942
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.261...2.0.262
## 2.0.261
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.261>
## What's Changed
* Add MA0179: Detect inefficient attribute existence checks by @Copilot
in https://github.com/meziantou/Meziantou.Analyzer/pull/939
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.260...2.0.261
## 2.0.260
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.260>
## What's Changed
* Add concurrency control to serialize CI runs on main branch by
@Copilot in https://github.com/meziantou/Meziantou.Analyzer/pull/938
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.259...2.0.260
## 2.0.259
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.259>
## What's Changed
* Add opt-in configuration for MA0153 to detect logging of types
containing DataClassification members by @Copilot in
https://github.com/meziantou/Meziantou.Analyzer/pull/936
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.258...2.0.259
## 2.0.258
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.258>
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.257...2.0.258
## 2.0.257
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.257>
## What's Changed
* Fix MA0042 to not flag SemaphoreSlim.Wait(0) as blocking by @Copilot
in https://github.com/meziantou/Meziantou.Analyzer/pull/934
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.256...2.0.257
## 2.0.256
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.256>
## What's Changed
* Clarify MA0093 only applies to event invocations, not regular method
calls by @Copilot in
https://github.com/meziantou/Meziantou.Analyzer/pull/933
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.255...2.0.256
## 2.0.255
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.255>
## What's Changed
* Use GlobalAnalyzerConfigFiles with global_level=-1 for analyzer
configuration by @Copilot in
https://github.com/meziantou/Meziantou.Analyzer/pull/932
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.254...2.0.255
## 2.0.254
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.254>
## What's Changed
* Add MA0178: Use TimeSpan.Zero instead of TimeSpan.FromXXX(0) by
@Copilot in https://github.com/meziantou/Meziantou.Analyzer/pull/929
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.253...2.0.254
## 2.0.253
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.253>
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.252...2.0.253
## 2.0.252
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.252>
## What's Changed
* Updated `NamedParameterAnalyzer` to handle language version checks for
C# 14 by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/925
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.251...2.0.252
## 2.0.251
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.251>
## What's Changed
* Add comprehensive CultureInsensitiveTypeAttribute documentation by
@Copilot in https://github.com/meziantou/Meziantou.Analyzer/pull/922
* Update to .NET 10 by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/924
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.250...2.0.251
## 2.0.250
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.250>
## What's Changed
* MA0011: Skip diagnostic for culture-invariant interpolated strings by
@Copilot in https://github.com/meziantou/Meziantou.Analyzer/pull/919
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.249...2.0.250
## 2.0.249
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.249>
## What's Changed
* Fix MA0095 to not report for CRTP-inherited IEquatable<T> by @Copilot
in https://github.com/meziantou/Meziantou.Analyzer/pull/918
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.248...2.0.249
## 2.0.248
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.248>
## What's Changed
* Update MA0053 to mention both class and record types by @Copilot in
https://github.com/meziantou/Meziantou.Analyzer/pull/915
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.247...2.0.248
## 2.0.247
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.247>
## What's Changed
* Update Roslyn dependencies and clean up PackageReferences by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/916
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.246...2.0.247
## 2.0.246
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.246>
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.245...2.0.246
## 2.0.245
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.245>
## What's Changed
* Fix MA0015 not detecting static ThrowIf methods on ArgumentException
and related types by @Copilot in
https://github.com/meziantou/Meziantou.Analyzer/pull/912
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.244...2.0.245
## 2.0.244
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.244>
## What's Changed
* Fix MA0011 not reported for types with ToString(IFormatProvider) but
no IFormattable by @Copilot in
https://github.com/meziantou/Meziantou.Analyzer/pull/910
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.243...2.0.244
## 2.0.243
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.243>
## What's Changed
* Add Roslyn analyzer for multiline XML comments by @Copilot in
https://github.com/meziantou/Meziantou.Analyzer/pull/908
## New Contributors
* @Copilot made their first contribution in
https://github.com/meziantou/Meziantou.Analyzer/pull/908
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.242...2.0.243
## 2.0.242
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.242>
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.241...2.0.242
## 2.0.241
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.241>
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.240...2.0.241
## 2.0.240
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.240>
## What's Changed
* Add copilot instructions by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/907
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.239...2.0.240
## 2.0.239
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.239>
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.238...2.0.239
## 2.0.238
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.238>
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.237...2.0.238
## 2.0.237
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.237>
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.236...2.0.237
## 2.0.236
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.236>
## What's Changed
* Document members of CultureInsensitiveTypeAttribute. by @drieseng in
https://github.com/meziantou/Meziantou.Analyzer/pull/902
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.235...2.0.236
## 2.0.235
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.235>
## What's Changed
* Add support for culture-insensitive default formats by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/898
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.234...2.0.235
## 2.0.234
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.234>
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.233...2.0.234
## 2.0.233
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.233>
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.232...2.0.233
## 2.0.232
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.232>
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.231...2.0.232
## 2.0.231
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.231>
## What's Changed
* Improve support for culture-sensitive ToString and support null format
by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/893
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.230...2.0.231
## 2.0.230
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.230>
## What's Changed
* Apply style suggestion by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/892
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.229...2.0.230
## 2.0.229
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.229>
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.228...2.0.229
## 2.0.228
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.228>
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.227...2.0.228
## 2.0.227
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.227>
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.226...2.0.227
## 2.0.226
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.226>
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.225...2.0.226
## 2.0.225
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.225>
## What's Changed
* Document CA1849 as being similar to MA0042 by @drieseng in
https://github.com/meziantou/Meziantou.Analyzer/pull/886
* Added support for analyzing methods with LoggerMessage attributes by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/888
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.224...2.0.225
## 2.0.224
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.224>
## What's Changed
* New rule: MA0176 - Optimize guid creation by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/884
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.223...2.0.224
## 2.0.223
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.223>
## What's Changed
* MA0016 skips conversion methods by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/883
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.222...2.0.223
## 2.0.222
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.222>
## What's Changed
* docs: enhance MA0090 and MA0098 rule documentation by @Meir017 in
https://github.com/meziantou/Meziantou.Analyzer/pull/874
* MA0042 fixer creates generic method call if generic method was called
by @Griboedoff in
https://github.com/meziantou/Meziantou.Analyzer/pull/881
## New Contributors
* @Griboedoff made their first contribution in
https://github.com/meziantou/Meziantou.Analyzer/pull/881
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.221...2.0.222
## 2.0.221
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.221>
## What's Changed
* New rules: MA0174 and MA0175 by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/879
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.220...2.0.221
## 2.0.220
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.220>
## What's Changed
* docs: Add multiple CA/MA analyzer rule mappings by @Meir017 in
https://github.com/meziantou/Meziantou.Analyzer/pull/871
* Enhance MA0048 diagnostic messages with type information by @Meir017
in https://github.com/meziantou/Meziantou.Analyzer/pull/873
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.219...2.0.220
## 2.0.219
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.219>
## What's Changed
* Fix code block formatting in README.md by @Meir017 in
https://github.com/meziantou/Meziantou.Analyzer/pull/865
## New Contributors
* @Meir017 made their first contribution in
https://github.com/meziantou/Meziantou.Analyzer/pull/865
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.218...2.0.219
## 2.0.218
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.218>
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.217...2.0.218
## 2.0.217
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.217>
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.216...2.0.217
## 2.0.216
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.216>
## What's Changed
* Make expression parsing more robust by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/830
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.215...2.0.216
## 2.0.215
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.215>
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.214...2.0.215
## 2.0.214
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.214>
## What's Changed
* Suggest using LazyInitializer instead of CompareExchange by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/828
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.213...2.0.214
## 2.0.213
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.213>
## What's Changed
* Use Meziantou SDK by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/826
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.212...2.0.213
## 2.0.212
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.212>
## What's Changed
* Add new rule to detect similar code in both side of a logical
operation by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/825
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.211...2.0.212
## 2.0.211
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.211>
## What's Changed
* Fix for MA0077 for `ref struct` and improve MA0066 to detect
`WithComparers` by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/824
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.210...2.0.211
## 2.0.210
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.210>
## What's Changed
* Use additional locations to report diagnostic on symbols with multiple
locations by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/821
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.209...2.0.210
## 2.0.209
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.209>
## What's Changed
* Add MA0171: Replace HasValue with pattern matching by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/819
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.208...2.0.209
## 2.0.208
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.208>
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.207...2.0.208
## 2.0.207
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.207>
## What's Changed
* Apply repository configuration by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/817
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.206...2.0.207
## 2.0.206
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.206>
## What's Changed
* Simplify msbuild properties by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/816
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.205...2.0.206
## 2.0.205
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.205>
## What's Changed
* MA0053 takes ctor visibility into account to determine if a class
should be sealed by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/815
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.204...2.0.205
## 2.0.204
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.204>
## What's Changed
* Convert sln to slnx by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/814
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.203...2.0.204
## 2.0.203
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.203>
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.202...2.0.203
## 2.0.202
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.202>
## What's Changed
* Add a rule to check parameters in attributes are valid by @meziantou
in https://github.com/meziantou/Meziantou.Analyzer/pull/809
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.201...2.0.202
## 2.0.201
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.201>
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.200...2.0.201
## 2.0.200
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.200>
## What's Changed
* MA0169 - Detect equality operators that should be replaced with Equals
method by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/805
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.199...2.0.200
## 2.0.199
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.199>
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.198...2.0.199
## 2.0.198
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.198>
## What's Changed
* Add CODEOWNERS file by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/802
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.197...2.0.198
## 2.0.197
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.197>
## What's Changed
* Add rule to detect non-readonly struct used for in or ref readonly
parameters by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/801
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.196...2.0.197
## 2.0.196
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.196>
## What's Changed
* Add attribute to indicate a type is culture insensitive by @meziantou
in https://github.com/meziantou/Meziantou.Analyzer/pull/799
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.195...2.0.196
## 2.0.195
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.195>
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.194...2.0.195
## 2.0.194
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.194>
## What's Changed
* Remove inaccessible local symbols by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/797
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.193...2.0.194
## 2.0.193
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.193>
## What's Changed
* Fix OverloadFinder by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/795
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.192...2.0.193
## 2.0.192
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.192>
## What's Changed
* Fix ArgumentOutOfRange in OverloadFinder by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/794
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.191...2.0.192
## 2.0.191
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.191>
## What's Changed
* Add new rules to suggest using TimeProvider by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/792
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.190...2.0.191
## 2.0.190
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.190>
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.189...2.0.190
## 2.0.189
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.189>
## What's Changed
* Update the report location to be on method name and arguments instead
of the InvocationExpression by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/790
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.188...2.0.189
## 2.0.188
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.188>
## What's Changed
* MA0002 skips IImmutableSet<string> by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/787
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.187...2.0.188
## 2.0.187
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.187>
## What's Changed
* Fix MA0048 in case when first type is not first node by @FrediKats in
https://github.com/meziantou/Meziantou.Analyzer/pull/785
## New Contributors
* @FrediKats made their first contribution in
https://github.com/meziantou/Meziantou.Analyzer/pull/785
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.186...2.0.187
## 2.0.186
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.186>
## What's Changed
* Align message to behavior for MA0157 by @martindisch in
https://github.com/meziantou/Meziantou.Analyzer/pull/783
## New Contributors
* @martindisch made their first contribution in
https://github.com/meziantou/Meziantou.Analyzer/pull/783
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.185...2.0.186
## 2.0.185
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.185>
## What's Changed
* Allow to disable all rules using a property by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/781
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.184...2.0.185
## 2.0.184
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.184>
## What's Changed
* Update global.json by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/778
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.183...2.0.184
## 2.0.183
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/2.0.183>
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.182...2.0.183
Commits viewable in [compare
view](https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.182...2.0.276).
</details>
Updated [Moq.Analyzers](https://github.com/rjmurillo/moq.analyzers) from
0.0.9 to 0.4.0.
<details>
<summary>Release notes</summary>
_Sourced from [Moq.Analyzers's
releases](https://github.com/rjmurillo/moq.analyzers/releases)._
## 0.4.0
# Moq.Analyzers 0.4.0
Welcome to Moq.Analyzers 0.4.0! This major release brings significant
improvements to code quality analysis, introduces new analyzers for
better Moq usage patterns, and includes comprehensive updates to our
infrastructure and dependencies.
## ✨ Highlights
### New Analyzers
This release introduces three powerful new analyzers to help you write
better Moq tests:
- **[Moq1207]** - SetupSequence validation analyzer ensures sequential
setups are used correctly
- **[Moq1420]** - Times usage validation helps you use verification
times specifications properly
- **[Moq1500]** - Raise method validation catches incorrect event
argument patterns
### Enhanced Diagnostic Messages
We've improved diagnostic messages across all analyzers to include
specific type and member names, making it easier to identify and fix
issues. Every analyzer now provides clearer, more actionable feedback.
### Symbol-Based Detection
Replaced string-based detection with comprehensive symbol-based analysis
for the `Raises` method, improving accuracy and performance of
event-related analyzers.
### Infrastructure Modernization
- **Migrated to .NET 10 SDK** for the latest tooling improvements
- **ARM64 runners** for faster CI/CD on modern hardware
- **Enhanced performance testing** with nightly regression detection
- **Automated dependency management** with Renovate
## 🎯 Breaking Changes
### Minimum SDK Version
Moq.Analyzers now requires **minimum .NET SDK 8** for development. This
aligns with the long-term support release and enables us to leverage
modern C# features.
## 🔧 Analyzer Improvements
### Coverage Expansion
We've significantly expanded test coverage for all Moq patterns:
- **Event patterns**: Comprehensive coverage for `SetupAdd`,
`SetupRemove`, `Raises`, and `RaisesAsync`
- **Async methods**: Full support for `Task`/`ValueTask` patterns
- **LINQ to Mocks**: Complete validation of query expressions
- **MockRepository**: Validation for repository-based mock creation
- **Argument matching**: Coverage for all `It.*` and custom matcher
patterns
- **Protected members**: Validation for `.Protected().Setup()` patterns
- **Callback signatures**: Advanced callback pattern support including
generic scenarios
### Moq 4.16+ Compatibility
... (truncated)
## 0.3.1
## Minor Bug Fix
fix: exception in code fix of explicit mock behavior
(https://github.com/rjmurillo/moq.analyzers/pull/701) @Youssef1313
#701
**Full Changelog**:
https://github.com/rjmurillo/moq.analyzers/compare/v0.3.0...v0.3.1
## 0.3.0
Moq.Analyzers v0.3.0 🎄
Holidays are coming and it's time for the last release of the year! 🎉
There's a lot that has gone into this release, mostly housekeeping and
bug fixes that are transparent to you. However, there are two new
diagnostics included in this release.
This will be the last release until we move to **v1.0.0**
## Analyzer Behavior Changes
* Remove false positive for Moq1200 when using parameterized lambda by
@rjmurillo in https://github.com/rjmurillo/moq.analyzers/pull/301
* Add new rule to enforce MockBehavior.Strict (Moq1410) by @rjmurillo
in https://github.com/rjmurillo/moq.analyzers/pull/302
## What's Changed
* Bump Nerdbank.GitVersioning from 3.6.143 to 3.6.146 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/232
* Bump Microsoft.Diagnostics.Tracing.TraceEvent from 3.1.15 to 3.1.16 by
@dependabot in https://github.com/rjmurillo/moq.analyzers/pull/228
* Add IOperation to DiagnosticExtensions and clean up overloads by
@MattKotsenas in https://github.com/rjmurillo/moq.analyzers/pull/233
* Bump nbgv from 3.6.143 to 3.6.146 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/230
* Bump Meziantou.Analyzer from 2.0.169 to 2.0.173 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/231
* Create a shared Common .projitems by @MattKotsenas in
https://github.com/rjmurillo/moq.analyzers/pull/235
* Remove ECS0200 suppression and update WellKnownTypes to not trigger
ECS0600 by @rjmurillo in
https://github.com/rjmurillo/moq.analyzers/pull/236
* Add BannedApiAnalyzer and ban direct use of Diagnostic.Create by
@MattKotsenas in https://github.com/rjmurillo/moq.analyzers/pull/239
* Add *.props and *.targets to XML section of .editorconfig template by
@MattKotsenas in https://github.com/rjmurillo/moq.analyzers/pull/240
* Bump Meziantou.Analyzer from 2.0.173 to 2.0.175 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/237
* Remove dead suppressions and dead code by @MattKotsenas in
https://github.com/rjmurillo/moq.analyzers/pull/242
* Add rule suppression docs to README and each rule by @MattKotsenas in
https://github.com/rjmurillo/moq.analyzers/pull/241
* Bump Meziantou.Analyzer from 2.0.175 to 2.0.176 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/243
* Disable SquiggleCop for PerfDiff by @MattKotsenas in
https://github.com/rjmurillo/moq.analyzers/pull/244
* Bump Roslynator.Analyzers from 4.12.8 to 4.12.9 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/246
* Bump Verify.Xunit from 27.0.1 to 27.1.0 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/247
* Use WellKnownTypeProvider + KnownSymbols pattern to simplify analyzers
by @MattKotsenas in https://github.com/rjmurillo/moq.analyzers/pull/245
* Bump Polyfill from 7.1.2 to 7.2.0 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/248
* Bump Verify.Xunit from 27.1.0 to 28.0.0 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/251
* Bump Meziantou.Analyzer from 2.0.176 to 2.0.177 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/249
* Bump Verify.Xunit from 28.0.0 to 28.1.3 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/253
* Bump Polyfill from 7.2.0 to 7.4.0 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/256
* Bump EffectiveCSharp.Analyzers from 0.1.0 to 0.2.0 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/250
* Bump Verify.Xunit from 28.1.3 to 28.2.0 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/257
* Update global.json to SDK 9 by @rjmurillo in
https://github.com/rjmurillo/moq.analyzers/pull/263
* Bump Meziantou.Analyzer from 2.0.177 to 2.0.179 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/262
* Bump ReportGenerator from 5.3.11 to 5.4.1 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/264
* Bump Verify.Xunit from 28.2.0 to 28.3.0 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/265
* Remove forced lf in .editorconfig by @MattKotsenas in
https://github.com/rjmurillo/moq.analyzers/pull/271
* Reduce severity of S3267: Loops should be simplified with "LINQ"
expressions by @MattKotsenas in
https://github.com/rjmurillo/moq.analyzers/pull/272
* Bump GetPackFromProject to fix race in .NET 9 SDK by @MattKotsenas in
https://github.com/rjmurillo/moq.analyzers/pull/274
* Bump Polyfill from 7.4.0 to 7.5.0 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/270
* Move "upload binlogs" CI step earlier in pipeline and run even if
failed by @MattKotsenas in
https://github.com/rjmurillo/moq.analyzers/pull/273
* Bump Verify.Xunit from 28.3.0 to 28.3.2 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/269
* Bump Microsoft.CodeAnalysis.BannedApiAnalyzers from
3.11.0-beta1.24454.1 to 3.11.0-beta1.24508.2 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/268
* Bump Meziantou.Analyzer from 2.0.179 to 2.0.181 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/275
... (truncated)
## 0.3.0-alpha.1
This is a small update to include a bug fix for code analyzers crashing
in the IDE.
## Full list of What's Changed
* Add AnalyzerUtilities to NuGet package by @MattKotsenas in
https://github.com/rjmurillo/moq.analyzers/pull/326
**Full Changelog**:
https://github.com/rjmurillo/moq.analyzers/compare/v0.3.0-alpha...v0.3.0-alpha.1
## 0.3.0-alpha
Moq.Analyzers v0.3.0 🎄
Holidays are coming and it's time for the last release of the year! 🎉
There's a lot that has gone into this release, mostly housekeeping and
bug fixes that are transparent to you. However, there are two new
diagnostics included in this release.
This will be the last release until we move to **v1.0.0**
## Analyzer Behavior Changes
* Remove false positive for Moq1200 when using parameterized lambda by
@rjmurillo in https://github.com/rjmurillo/moq.analyzers/pull/301
* Add new rule to enforce MockBehavior.Strict (Moq1410) by @rjmurillo
in https://github.com/rjmurillo/moq.analyzers/pull/302
## Full List of What's Changed
* Bump Nerdbank.GitVersioning from 3.6.143 to 3.6.146 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/232
* Bump Microsoft.Diagnostics.Tracing.TraceEvent from 3.1.15 to 3.1.16 by
@dependabot in https://github.com/rjmurillo/moq.analyzers/pull/228
* Add IOperation to DiagnosticExtensions and clean up overloads by
@MattKotsenas in https://github.com/rjmurillo/moq.analyzers/pull/233
* Bump nbgv from 3.6.143 to 3.6.146 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/230
* Bump Meziantou.Analyzer from 2.0.169 to 2.0.173 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/231
* Create a shared Common .projitems by @MattKotsenas in
https://github.com/rjmurillo/moq.analyzers/pull/235
* Remove ECS0200 suppression and update WellKnownTypes to not trigger
ECS0600 by @rjmurillo in
https://github.com/rjmurillo/moq.analyzers/pull/236
* Add BannedApiAnalyzer and ban direct use of Diagnostic.Create by
@MattKotsenas in https://github.com/rjmurillo/moq.analyzers/pull/239
* Add *.props and *.targets to XML section of .editorconfig template by
@MattKotsenas in https://github.com/rjmurillo/moq.analyzers/pull/240
* Bump Meziantou.Analyzer from 2.0.173 to 2.0.175 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/237
* Remove dead suppressions and dead code by @MattKotsenas in
https://github.com/rjmurillo/moq.analyzers/pull/242
* Add rule suppression docs to README and each rule by @MattKotsenas in
https://github.com/rjmurillo/moq.analyzers/pull/241
* Bump Meziantou.Analyzer from 2.0.175 to 2.0.176 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/243
* Disable SquiggleCop for PerfDiff by @MattKotsenas in
https://github.com/rjmurillo/moq.analyzers/pull/244
* Bump Roslynator.Analyzers from 4.12.8 to 4.12.9 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/246
* Bump Verify.Xunit from 27.0.1 to 27.1.0 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/247
* Use WellKnownTypeProvider + KnownSymbols pattern to simplify analyzers
by @MattKotsenas in https://github.com/rjmurillo/moq.analyzers/pull/245
* Bump Polyfill from 7.1.2 to 7.2.0 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/248
* Bump Verify.Xunit from 27.1.0 to 28.0.0 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/251
* Bump Meziantou.Analyzer from 2.0.176 to 2.0.177 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/249
* Bump Verify.Xunit from 28.0.0 to 28.1.3 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/253
* Bump Polyfill from 7.2.0 to 7.4.0 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/256
* Bump EffectiveCSharp.Analyzers from 0.1.0 to 0.2.0 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/250
* Bump Verify.Xunit from 28.1.3 to 28.2.0 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/257
* Update global.json to SDK 9 by @rjmurillo in
https://github.com/rjmurillo/moq.analyzers/pull/263
* Bump Meziantou.Analyzer from 2.0.177 to 2.0.179 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/262
* Bump ReportGenerator from 5.3.11 to 5.4.1 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/264
* Bump Verify.Xunit from 28.2.0 to 28.3.0 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/265
* Remove forced lf in .editorconfig by @MattKotsenas in
https://github.com/rjmurillo/moq.analyzers/pull/271
* Reduce severity of S3267: Loops should be simplified with "LINQ"
expressions by @MattKotsenas in
https://github.com/rjmurillo/moq.analyzers/pull/272
* Bump GetPackFromProject to fix race in .NET 9 SDK by @MattKotsenas in
https://github.com/rjmurillo/moq.analyzers/pull/274
* Bump Polyfill from 7.4.0 to 7.5.0 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/270
* Move "upload binlogs" CI step earlier in pipeline and run even if
failed by @MattKotsenas in
https://github.com/rjmurillo/moq.analyzers/pull/273
* Bump Verify.Xunit from 28.3.0 to 28.3.2 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/269
* Bump Microsoft.CodeAnalysis.BannedApiAnalyzers from
3.11.0-beta1.24454.1 to 3.11.0-beta1.24508.2 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/268
* Bump Meziantou.Analyzer from 2.0.179 to 2.0.181 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/275
... (truncated)
## 0.2.0
## Changes
* Add rule to explicitly pick MockBehavior by @MattKotsenas in
https://github.com/rjmurillo/moq.analyzers/pull/226
* Fix false detection in Moq1201 in Moq 4.16.0 by @rjmurillo in
https://github.com/rjmurillo/moq.analyzers/pull/224
* Fix false detection in Moq1200 using async tasks by @rjmurillo in
https://github.com/rjmurillo/moq.analyzers/pull/221
## Housekeeping
* Add CODEOWNERS by @MattKotsenas in
https://github.com/rjmurillo/moq.analyzers/pull/193
* Bump Verify.Xunit from 26.2.0 to 26.4.0 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/197
* Bump Microsoft.NET.Test.Sdk from 17.11.0 to 17.11.1 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/196
* Bump DotNet.ReproducibleBuilds from 1.2.4 to 1.2.25 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/201
* Bump DotNet.ReproducibleBuilds.Isolated from 1.2.4 to 1.2.25 by
@dependabot in https://github.com/rjmurillo/moq.analyzers/pull/200
* Bump Verify.Xunit from 26.4.0 to 26.4.4 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/199
* Bump ReportGenerator from 5.3.8 to 5.3.9 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/195
* Update SDK to get newer version of Source Link by @MattKotsenas in
https://github.com/rjmurillo/moq.analyzers/pull/202
* Bump Verify.Xunit from 26.4.4 to 26.5.0 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/205
* Bump Roslynator.Analyzers from 4.12.4 to 4.12.5 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/204
* Bump Verify.Xunit from 26.5.0 to 26.6.0 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/207
* Bump Meziantou.Analyzer from 2.0.163 to 2.0.168 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/206
* Bump Roslynator.Analyzers from 4.12.5 to 4.12.6 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/209
* Bump ReportGenerator from 5.3.9 to 5.3.10 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/212
* Bump Roslynator.Analyzers from 4.12.6 to 4.12.7 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/213
* Bump Meziantou.Analyzer from 2.0.168 to 2.0.169 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/211
* Bump xunit from 2.9.0 to 2.9.2 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/210
* Use dotnet template for .gitattributes by @MattKotsenas in
https://github.com/rjmurillo/moq.analyzers/pull/215
**Full Changelog**:
https://github.com/rjmurillo/moq.analyzers/compare/v0.1.2...v0.2.0
## 0.1.2
## What's Changed
Lots of housekeeping and a couple of fixes and enhancements.
### Enhancements and Bug fixes
* Add Mock.Of<T> and MockRepository support to
ConstructorArgumentsShouldMatchAnalyzer by @rjmurillo in
https://github.com/rjmurillo/moq.analyzers/pull/140
* Moq1100 incorrectly firing on nullable parameters by @marcovr
@rjmurillo in https://github.com/rjmurillo/moq.analyzers/pull/187
### Other Changes
* Update version.json to 0.2.0 by @rjmurillo in
https://github.com/rjmurillo/moq.analyzers/pull/142
* Remove CSharpGuidelinesAnalyzer and associated editorconfig values by
@rjmurillo in https://github.com/rjmurillo/moq.analyzers/pull/145
* Bump ReportGenerator from 5.3.6 to 5.3.7 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/138
* Bump Newtonsoft.Json from 13.0.1 to 13.0.3 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/134
* Bump Microsoft.Extensions.Logging from 6.0.0-preview.5.21301.5 to
8.0.0 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/132
* Bump Microsoft.Diagnostics.Tracing.TraceEvent from 3.0.2 to 3.1.12 by
@dependabot in https://github.com/rjmurillo/moq.analyzers/pull/131
* Bump Meziantou.Analyzer from 2.0.159 to 2.0.160 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/151
* Bump xunit from 2.8.1 to 2.9.0 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/148
* Bump xunit.runner.visualstudio from 2.8.1 to 2.8.2 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/149
* Bump Verify.Xunit from 25.0.4 to 25.3.1 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/152
* Bump SonarAnalyzer.CSharp from 9.28.0.94264 to 9.29.0.95321 by
@dependabot in https://github.com/rjmurillo/moq.analyzers/pull/154
* Bump Verify.Xunit from 25.3.1 to 25.3.2 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/158
* Bump Microsoft.Diagnostics.Tracing.TraceEvent from 3.1.12 to 3.1.13 by
@dependabot in https://github.com/rjmurillo/moq.analyzers/pull/157
* Bump Meziantou.Analyzer from 2.0.160 to 2.0.161 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/156
* Bump ReportGenerator from 5.3.7 to 5.3.8 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/155
* Bump Verify.Xunit from 25.3.2 to 26.1.5 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/164
* Bump Meziantou.Analyzer from 2.0.161 to 2.0.162 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/163
* Bump SonarAnalyzer.CSharp from 9.29.0.95321 to 9.30.0.95878 by
@dependabot in https://github.com/rjmurillo/moq.analyzers/pull/160
* Enable TreatWarningsAsErrors by @MattKotsenas in
https://github.com/rjmurillo/moq.analyzers/pull/165
* Disable rollForward for SDK in global.json by @MattKotsenas in
https://github.com/rjmurillo/moq.analyzers/pull/170
* Add SquiggleCop to baseline analyzer settings by @MattKotsenas in
https://github.com/rjmurillo/moq.analyzers/pull/166
* Bump Verify.Xunit from 26.1.5 to 26.1.6 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/168
* Bump Meziantou.Xunit.ParallelTestFramework from 2.2.0 to 2.3.0 by
@dependabot in https://github.com/rjmurillo/moq.analyzers/pull/169
* Bump Meziantou.Analyzer from 2.0.162 to 2.0.163 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/167
* Update SquiggleCop and remove ErrorLog property by @MattKotsenas in
https://github.com/rjmurillo/moq.analyzers/pull/174
* Bump SonarAnalyzer.CSharp from 9.30.0.95878 to 9.31.0.96804 by
@dependabot in https://github.com/rjmurillo/moq.analyzers/pull/175
* Bump Nerdbank.GitVersioning from 3.6.139 to 3.6.141 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/178
* Bump Verify.Xunit from 26.1.6 to 26.2.0 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/180
* Bump Microsoft.VisualStudio.Threading.Analyzers from 17.10.48 to
17.11.20 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/181
* Bump nbgv from 3.6.139 to 3.6.141 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/179
* Bump SquiggleCop.Tasks from 1.0.13 to 1.0.26 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/185
* Bump squigglecop.tool from 1.0.13 to 1.0.26 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/186
* Bump Microsoft.NET.Test.Sdk from 17.10.0 to 17.11.0 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/184
* Bump SonarAnalyzer.CSharp from 9.31.0.96804 to 9.32.0.97167 by
@dependabot in https://github.com/rjmurillo/moq.analyzers/pull/183
* Add Effective C# analyzers and update SquiggleCop baselines by
@rjmurillo in https://github.com/rjmurillo/moq.analyzers/pull/182
* Bump Nerdbank.GitVersioning from 3.6.141 to 3.6.143 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/189
* Bump Microsoft.Diagnostics.Tracing.TraceEvent from 3.1.13 to 3.1.15 by
@dependabot in https://github.com/rjmurillo/moq.analyzers/pull/190
* Bump nbgv from 3.6.141 to 3.6.143 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/188
* Bump dependabot/fetch-metadata from 1.1.1 to 2.2.0 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/192
... (truncated)
## 0.1.1
Lots of "housekeeping" this release, and a few bug fixes. We also now
have rule documentation! Special thanks to @MattKotsenas for his
contributions to make working on the analyzers easier and improving our
confidence and productivity.
**Full Changelog**:
https://github.com/rjmurillo/moq.analyzers/compare/v0.1.0...v0.1.1
## What's Changed
Ownership of the `Moq.Analyzers` and `Moq.Autocomplete` has been
transferred from @Litee to @rjmurillo.
### Bug fixes
* Moq1002: Update constructor checks by @rjmurillo in
https://github.com/rjmurillo/moq.analyzers/pull/115. This resolves #55
by @MattKotsenas
* Refactor Moq1300 to use IOperation-based analysis by @MattKotsenas in
https://github.com/rjmurillo/moq.analyzers/pull/125
### Changes to rules
There _should_ be no behavioral differences with these changes to the
rule code. If you find any, please [submit a new
issue](https://github.com/rjmurillo/moq.analyzers/issues/new).
* Clean up README and add docs for each analyzer rule by @MattKotsenas
in https://github.com/rjmurillo/moq.analyzers/pull/77
* Add analyzer release tracking by @MattKotsenas in
https://github.com/rjmurillo/moq.analyzers/pull/84
* Add cancellation tokens to methods that have a parameter but we don't
pass by @rjmurillo in
https://github.com/rjmurillo/moq.analyzers/pull/52
* Enable ConcurrentExecution and disable generated code analysis by
@MattKotsenas in https://github.com/rjmurillo/moq.analyzers/pull/70
* Update code to remove warnings from backlog by @rjmurillo in
https://github.com/rjmurillo/moq.analyzers/pull/73
* Remove RegEx from analyzers by @MattKotsenas in
https://github.com/rjmurillo/moq.analyzers/pull/81
* Remove period from analyzer messages and inline in the analyzer
classes by @MattKotsenas in
https://github.com/rjmurillo/moq.analyzers/pull/86
### Updates to test and infrastructure
* Refactor tests to simplify and inline test cases by @MattKotsenas in
https://github.com/rjmurillo/moq.analyzers/pull/57
* Update analysis mode and warning level to preview and 9999 by
@rjmurillo in https://github.com/rjmurillo/moq.analyzers/pull/59
* Extract code analysis to its own build slice and update analyzers to
latest versions by @MattKotsenas in
https://github.com/rjmurillo/moq.analyzers/pull/60
* Move test packages to build slice, update to latest version, and
enable parallel tests by @MattKotsenas in
https://github.com/rjmurillo/moq.analyzers/pull/61
* Replace our custom test harness with `Microsoft.CodeAnalysis` testing
harness by @MattKotsenas in
https://github.com/rjmurillo/moq.analyzers/pull/65
* Clean up of using statements by @rjmurillo in
https://github.com/rjmurillo/moq.analyzers/pull/66
* Rename `master` to `main` by @MattKotsenas in
https://github.com/rjmurillo/moq.analyzers/pull/69
* Cache reference assemblies between tests to improve performance by
@MattKotsenas in https://github.com/rjmurillo/moq.analyzers/pull/71
* Convert from var to explicit type by @rjmurillo in
https://github.com/rjmurillo/moq.analyzers/pull/74
* Refactor unit tests: data driven tests and leverage
`Microsoft.CodeAnalysis.Testing` patterns by @MattKotsenas in
https://github.com/rjmurillo/moq.analyzers/pull/76
* Add Code coverage report by @MattKotsenas in
https://github.com/rjmurillo/moq.analyzers/pull/79
* Fix `dotnet test` when not generating code coverage reports by
@MattKotsenas in https://github.com/rjmurillo/moq.analyzers/pull/80
* Refactor test cases to matrix on `Moq` version by @MattKotsenas in
https://github.com/rjmurillo/moq.analyzers/pull/82
* Fix SA0001: XML comment analysis is disabled due to project
configuration by @MattKotsenas in
https://github.com/rjmurillo/moq.analyzers/pull/87
* Fix trivial warnings by @MattKotsenas in
https://github.com/rjmurillo/moq.analyzers/pull/88
* Update README.md to add leading and trailing pipes in table by
@rjmurillo in https://github.com/rjmurillo/moq.analyzers/pull/94
* Create dependabot.yml by @rjmurillo in
https://github.com/rjmurillo/moq.analyzers/pull/93
* Update main.yml to add codacy test coverage by @rjmurillo in
https://github.com/rjmurillo/moq.analyzers/pull/92
* Add more analyzers and bump `Meziantou.Analzer` to latest version by
@rjmurillo in https://github.com/rjmurillo/moq.analyzers/pull/89
* Bump `Verify.Xunit` from 25.0.1 to 25.0.3 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/100
* Remove `Microsoft.CodeAnalysis.CSharp.Analyzer.Testing` by
@MattKotsenas in https://github.com/rjmurillo/moq.analyzers/pull/102
* Dependabot ignore packages that impact customer compatibility by
@MattKotsenas in https://github.com/rjmurillo/moq.analyzers/pull/101
* Bump `Microsoft.CodeAnalysis.CSharp.CodeFix.Testing` from
1.1.2-beta1.24273.1 to 1.1.2-beta1.24314.1 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/103
* Bump `Nerdbank.GitVersioning` from 3.6.133 to 3.6.139 by @dependabot
in https://github.com/rjmurillo/moq.analyzers/pull/99
* Bump `Meziantou.Analyzer` from 2.0.155 to 2.0.158 by @dependabot in
https://github.com/rjmurillo/moq.analyzers/pull/96
... (truncated)
## 0.1.0
## What's Changed
* Remove the Visual Studio Extension VSIX by @rjmurillo in
https://github.com/Litee/moq.analyzers/pull/16
* Update TargetFramework to NET Standard 2.0 by @rjmurillo in
https://github.com/Litee/moq.analyzers/pull/17
* Update constructor analyzer (Moq1002) to validate parameters of
abstract classes by @rjmurillo in
https://github.com/Litee/moq.analyzers/pull/20, fixes #1
### Non-functional Changes
* Create codeql.yml to analyze C# code by @rjmurillo in
https://github.com/Litee/moq.analyzers/pull/9
* Create a basic GitHub Actions pipeline by @MattKotsenas in
https://github.com/Litee/moq.analyzers/pull/18
* Fix GitHub actions branch 'main' -> 'master' by @MattKotsenas in
https://github.com/Litee/moq.analyzers/pull/21
* Use .NET 8 SDK's artifacts output and enable test reports in CI by
@MattKotsenas in https://github.com/Litee/moq.analyzers/pull/23
* Update Moq.Analyzers.Test.csproj to NET 8 by @rjmurillo in
https://github.com/Litee/moq.analyzers/pull/24
* Migrate from ApprovalTests to Verify by @MattKotsenas in
https://github.com/Litee/moq.analyzers/pull/25
* Update main.yml to upload .received on failure by @rjmurillo in
https://github.com/Litee/moq.analyzers/pull/34
* Add .nupkg baseline with Verify by @MattKotsenas in
https://github.com/Litee/moq.analyzers/pull/30
* Add nbgv tool to automate versioning by @MattKotsenas in
https://github.com/Litee/moq.analyzers/pull/35
* Add .gitattributes file and normalize line endings by @rjmurillo in
https://github.com/Litee/moq.analyzers/pull/33
* Add .editorconfig and enable code analysis by @MattKotsenas in
https://github.com/Litee/moq.analyzers/pull/37
* Convert to Central Package Management with transitive pinning enabled
by @MattKotsenas in https://github.com/Litee/moq.analyzers/pull/39
* Set package README, license expression, and development dependency by
@MattKotsenas in https://github.com/Litee/moq.analyzers/pull/41
* Move usings to top of file and using file-scoped namespaces by
@MattKotsenas in https://github.com/Litee/moq.analyzers/pull/40
* Follow reproducible builds best practices for package by
@MattKotsenas in https://github.com/Litee/moq.analyzers/pull/44
* Remove package dependencies and don't publish analyzer as a lib by
@MattKotsenas in https://github.com/Litee/moq.analyzers/pull/49
* Update Moq.Analyzers.csproj NuGet package metadata by @rjmurillo in
https://github.com/Litee/moq.analyzers/pull/50
## New Contributors
* @MattKotsenas made their first contribution in
https://github.com/Litee/moq.analyzers/pull/18
**Full Changelog**:
https://github.com/Litee/moq.analyzers/compare/v0.0.9...v0.1.0
Commits viewable in [compare
view](https://github.com/rjmurillo/moq.analyzers/compare/v0.0.9...v0.4.0).
</details>
Updated [Roslynator.Analyzers](https://github.com/dotnet/roslynator)
from 4.12.9 to 4.15.0.
<details>
<summary>Release notes</summary>
_Sourced from [Roslynator.Analyzers's
releases](https://github.com/dotnet/roslynator/releases)._
## 4.15.0
### Added
- Add option
`roslynator_null_conditional_operator.avoid_negative_boolean_comparison`
([PR](https://github.com/dotnet/roslynator/pull/1688))
- Do not suggest to use null-conditional operator when result would be
`... != true/false`
- Applicable for
[RCS1146](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1146)
### Fixed
- Fix analyzer
[RCS1172](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1172)
([PR](https://github.com/dotnet/roslynator/pull/1710))
- [CLI] Fix `loc` command
([PR](https://github.com/dotnet/roslynator/pull/1711))
- Exclude ref-field backed properties from
[RCS1085](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1085)
([PR](https://github.com/dotnet/roslynator/pull/1718) by @ovska)
- [CLI] Fix `rename-symbol` scope option not being applied correctly
([PR](https://github.com/dotnet/roslynator/pull/1720) by @andrtmschkw)
- [CLI] Fix `rename-symbol` support for top-level statement
([PR](https://github.com/dotnet/roslynator/pull/1721) by @andrtmschkw)
### Changed
- Migrate to .NET 10 (including command-line tool)
([PR](https://github.com/dotnet/roslynator/pull/1727))
## 4.14.1
### Added
- [CLI] Add support for `slnx` files
([PR](https://github.com/dotnet/roslynator/pull/1662) by @darthtrevino)
- Bump Roslyn to 4.14.0
- Drop support for .NET 7 SDK
### Fixed
- Fix analyzer
[RCS1246](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1246)
([PR](https://github.com/dotnet/roslynator/pull/1676))
- Fix analyzer
[RCS1248](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1248)
([PR](https://github.com/dotnet/roslynator/pull/1677))
- Fix analyzer
[RCS1203](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1203)
([PR](https://github.com/dotnet/roslynator/pull/1683))
- Fix analyzer
[RCS1043](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1043)
([PR](https://github.com/dotnet/roslynator/pull/1684))
- Fix analyzer
[RCS1213](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1213)
([PR](https://github.com/dotnet/roslynator/pull/1686))
- Add unity method `OnRectTransformDimensionsChange`
- Fix analyzer
[RCS1253](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1253)
([PR](https://github.com/dotnet/roslynator/pull/1687))
- Fix refactoring [Check expression for
null](https://josefpihrt.github.io/docs/roslynator/refactorings/RR0024)
([PR](https://github.com/dotnet/roslynator/pull/1682))
### Changed
- Change behavior of analyzer
[RCS1206](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1206)
([PR](https://github.com/dotnet/roslynator/pull/1685))
- The condition for option `omit_when_single_line` will be that the
braces/brackets are on the same line, not just the expression in the
braces/brackets
## 4.14.0
### Added
- [CLI] Add support for GitLab analyzer reports
([PR](https://github.com/dotnet/roslynator/pull/1633))
### Fixed
- Fix analyzer
[RCS1264](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1264)
([PR](https://github.com/dotnet/roslynator/pull/1666))
- Fix analyzer
[RCS1229](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1229)
([PR](https://github.com/dotnet/roslynator/pull/1667))
- Fix analyzer
[RCS1250](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1250)
([PR](https://github.com/dotnet/roslynator/pull/1652) by @aihnatiuk)
- Fix analyzer
[RCS1260](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1260)
([PR](https://github.com/dotnet/roslynator/pull/1668))
- Fix analyzer
[RCS1105](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1105)
([PR](https://github.com/dotnet/roslynator/pull/1669))
- Fix analyzer
[RCS1260](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1260)
([PR](https://github.com/dotnet/roslynator/pull/1672))
### Changed
- Disable analyzer
[RCS1036](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1036)
by default ([PR](https://github.com/dotnet/roslynator/pull/1671))
- Use analyzer
[RCS0063](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS0063)
instead
### Removed
- Remove legacy config options
([PR](https://github.com/dotnet/roslynator/pull/1304))
## 4.13.1
### Added
- Support custom path of a test file
([PR](https://github.com/dotnet/roslynator/pull/1609))
- It's possible to specify a directory path and/or a file name of a test
file.
- Applies to testing library (Roslynator.Testing.*).
## 4.13.0
### Fixed
- Fix analyzer
[RCS1229](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1229)
([PR](https://github.com/dotnet/roslynator/pull/1618))
- Fix analyzer
[RCS1174](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1174)
([PR](https://github.com/dotnet/roslynator/pull/1619))
- Fix analyzer
[RCS0010](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS0010)
([PR](https://github.com/dotnet/roslynator/pull/1620))
- Fix analyzer
[RCS0005](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS0005)
([PR](https://github.com/dotnet/roslynator/pull/1621))
### Added
- Add analyzer "Put expression body on its own line"
[RCS0062](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS0062)
([PR](https://github.com/dotnet/roslynator/pull/1593) by @cbersch)
- Affects analyzer
[RCS1016](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1016)
- Affects refactoring
[RR0169](https://josefpihrt.github.io/docs/roslynator/refactorings/RR0169)
### Changed
- Move analyzer
[RCS1036](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1036)
to Formatting.Analyzers as
[RCS0063](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS0063)
([PR](https://github.com/dotnet/roslynator/pull/1600))
- Old analyzer still works but is marked as obsolete.
- Bump Roslyn to 4.12.0
([PR](https://github.com/dotnet/roslynator/pull/1623))
- Applies to CLI and testing library.
- Bump `Microsoft.Build.Locator` to 1.7.8
([PR](https://github.com/dotnet/roslynator/pull/1622))
## 4.12.11
### Added
- [CLI] Add support for .NET 9
([PR](https://github.com/dotnet/roslynator/pull/1605))
### Fixed
- Fix refactoring 'Change accessibility'
([RR0186](https://josefpihrt.github.io/docs/roslynator/refactorings/RR0186))
([PR](https://github.com/dotnet/roslynator/pull/1599))
- Fix analyzer
[RCS1264](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1264)
([PR](https://github.com/dotnet/roslynator/pull/1604))
### Changed
- Move `DiagnosticRules` and `DiagnosticIdentifiers` to
`Roslynator.Common`
([PR](https://github.com/dotnet/roslynator/pull/1597))
## 4.12.10
### Fixed
- Fix analyzer
[RCS1213](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1213)
([PR](https://github.com/dotnet/roslynator/pull/1586))
- Improve code fixe…
Fixes #78
Add rule "Moq1400: Explicitly choose a mocking behavior instead of relying on the default (Loose) behavior"
This addresses a top pain point for Moq in large teams: accidentally relying on Moq's default "loose" behavior. Not specifying a behavior or specifying
MockBehavior.Defaultinnew Mock(),Mock.Of(), ornew MockRepository()raises a warning.This change does not enforce
MockBehavior.Stricteverywhere. That will be a separate rule (coming later) as it's more controversial and thus likely requires some configuration.Summary by CodeRabbit
New Features
Moq1400, to enforce explicit selection of mocking behavior in the Moq framework.Bug Fixes
Mock.As()method is only used with interface types.Tests
SetExplicitMockBehaviorAnalyzerto verify its functionality in detecting missing explicit mock behavior.Documentation