Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Moq1100 incorrectly firing on nullable parameters #187

Merged

Conversation

rjmurillo
Copy link
Owner

@rjmurillo rjmurillo commented Aug 26, 2024

Update type comparison to use ClassifyConversion to check if the types are assignable, rather than stringly strictly equal.

Changes:

  • Add check for types based on assignability (which also covers user-defined implicit and explicit conversions), rather than strictly equal with types.
  • Add logging for test type to aid in debugging cases
  • Update detection (span for diagnostic is tighter now)
  • Add repro for issue reported in Moq1100 incorrectly firing on nullable parameters #172 (thanks @marcovr!)
  • Add test cases for user-defined implicit and explicit conversions (thanks @MattKotsenas!)

@rjmurillo rjmurillo linked an issue Aug 26, 2024 that may be closed by this pull request
Copy link

codacy-production bot commented Aug 26, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.07% (target: -1.00%) 100.00% (target: 95.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (a80f55a) 551 509 92.38%
Head commit (7b16be7) 556 (+5) 514 (+5) 92.45% (+0.07%)

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

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#187) 16 16 100.00%

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

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

@rjmurillo rjmurillo added the analyzers Change that impacts an analyzer behavior label Aug 26, 2024
@rjmurillo rjmurillo added this to the v0.2.0 milestone Aug 26, 2024
@rjmurillo rjmurillo marked this pull request as ready for review August 26, 2024 19:59
@rjmurillo rjmurillo requested a review from MattKotsenas August 26, 2024 19:59
@rjmurillo rjmurillo self-assigned this Aug 26, 2024
@rjmurillo rjmurillo force-pushed the bug/172-moq1100-incorrectly-firing-on-nullable-parameters branch from f28f271 to 771794c Compare August 27, 2024 19:02
@rjmurillo rjmurillo requested a review from MattKotsenas August 27, 2024 22:09
Copy link

codeclimate bot commented Aug 27, 2024

Code Climate has analyzed commit 7b16be7 and detected 0 issues on this pull request.

View more on Code Climate.

@rjmurillo rjmurillo enabled auto-merge (squash) August 28, 2024 11:21
@rjmurillo rjmurillo merged commit 993844f into main Aug 28, 2024
11 checks passed
@rjmurillo rjmurillo deleted the bug/172-moq1100-incorrectly-firing-on-nullable-parameters branch August 28, 2024 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzers Change that impacts an analyzer behavior bug enhancement releasable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Moq1100 incorrectly firing on nullable parameters
2 participants