-
Notifications
You must be signed in to change notification settings - Fork 32
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
Analyzer for SameAs when used on Value Types. #278
Conversation
src/nunit.analyzers.tests/SameAsOnValueTypes/SameAsOnValueTypesAnalyzerTests.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work @manfred-brands. I've only found a handful of nitpick and nothing major.
src/nunit.analyzers/SameAsOnValueTypes/SameAsOnValueTypesCodeFix.cs
Outdated
Show resolved
Hide resolved
src/nunit.analyzers/SameAsOnValueTypes/SameAsOnValueTypesCodeFix.cs
Outdated
Show resolved
Hide resolved
src/nunit.analyzers/SameAsOnValueTypes/SameAsOnValueTypesAnalyzer.cs
Outdated
Show resolved
Hide resolved
a1dfebd
to
d0ed4f4
Compare
Thanks @mikkelbu for the review. Review changes applied and squashed. Ready for merge. |
What do you think about handling |
@jnm2 I did think of that and assumed people would convert first. But what if they disable the Classic To Constraint rules then they would get no warning. |
@mikkelbu I changed the Identifier from NUnit2040 into NUnit1029. The 2k range is used for ClassicAssert conversions. |
Updated the branch to support the Classic Assert.AreSame and Assert.AreNotSame methods including matching code fix to convert to AreEqual and AreNotEqual respectively. |
As far as I remember 1k range is used for Structure analyzers, and 2k - for Assertion analyzers. |
I see now that the SameAsIncompatibleTypesAnalyzer uses 2020. Reverted the commit. |
9ddd440
to
b14159e
Compare
@Dreamescaper Is right (I plan to make this more clear in the TOC by having two separate tables. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@manfred-brands It looks good to me (and good that you also solved the classic case), so I'm happy to merge it as it is, but if you want to merge commits or similar then please tell me.
CodeFix to replace SameAs with IsEqualTo
b14159e
to
0c2b2d7
Compare
@mikkelbu Branch updates. Ready for merge again. |
Thanks for the work @manfred-brands, I'll merge it now. |
CodeFix to replace SameAs with IsEqualTo
Fixes #276