-
Notifications
You must be signed in to change notification settings - Fork 33
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
Make best attempt at fixing trivia #754
Make best attempt at fixing trivia #754
Conversation
By the way, can anyone assign the ticket and the PR to me? |
Done. |
All tests are passing now. |
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.
Thanks @Bartleby2718 for your contribution.
Your changes and new tests are comprehensive.
There is, as expected, a lot of repeated:
return (actualArgument, constraintArgument.WithTriviaFrom(actualArgument));
I wonder if you can drop all those and only move this to the ClassicModelAssertUsageCodeFix
, where you already deal with the Trivia from the first and last argument.
src/nunit.analyzers/ConstraintUsage/SomeItemsConstraintUsageCodeFix.cs
Outdated
Show resolved
Hide resolved
src/nunit.analyzers/ClassicModelAssertUsage/AreEqualClassicModelAssertUsageCodeFix.cs
Outdated
Show resolved
Hide resolved
src/nunit.analyzers/ClassicModelAssertUsage/AreNotEqualClassicModelAssertUsageCodeFix.cs
Outdated
Show resolved
Hide resolved
src/nunit.analyzers/ClassicModelAssertUsage/AreNotSameClassicModelAssertUsageCodeFix.cs
Outdated
Show resolved
Hide resolved
src/nunit.analyzers/ClassicModelAssertUsage/AreSameClassicModelAssertUsageCodeFix.cs
Outdated
Show resolved
Hide resolved
src/nunit.analyzers/ClassicModelAssertUsage/ClassicModelAssertUsageCodeFix.cs
Outdated
Show resolved
Hide resolved
src/nunit.analyzers/ClassicModelAssertUsage/ClassicModelAssertUsageCodeFix.cs
Outdated
Show resolved
Hide resolved
src/nunit.analyzers/ClassicModelAssertUsage/ContainsClassicModelAssertUsageCodeFix.cs
Outdated
Show resolved
Hide resolved
…x; add more tests
@manfred-brands I've:
I feel much better about the changes now. Thanks for the suggestions! |
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.
@Bartleby2718 I think we are almost there.
The changes to actual CodeFix are far less than before.
Some small comments.
src/nunit.analyzers/ConstraintUsage/BaseConditionConstraintCodeFix.cs
Outdated
Show resolved
Hide resolved
...nunit.analyzers.tests/ClassicModelAssertUsage/AreEqualClassicModelAssertUsageCodeFixTests.cs
Outdated
Show resolved
Hide resolved
src/nunit.analyzers.tests/ConstraintsUsage/StringConstraintUsageCodeFixTests.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.
Thanks @Bartleby2718. This looks good now.
@mikkelbu Could you review this one when you get a chance? |
Sorry for the slow answer, but I've had very little spare time the last couple of weeks. I should have time to look at it tonight (in 8-9 hours time) |
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.
Looks great @Bartleby2718. I've only added a handful of some minor nit-pick comments, but the overall PR is great. Thanks for the contribution 👍.
src/nunit.analyzers/ConstraintUsage/BaseConditionConstraintCodeFix.cs
Outdated
Show resolved
Hide resolved
src/nunit.analyzers.tests/ConstraintsUsage/StringConstraintUsageCodeFixTests.cs
Outdated
Show resolved
Hide resolved
...nalyzers.tests/ClassicModelAssertUsage/IsNotInstanceOfClassicModelAssertUsageCodeFixTests.cs
Outdated
Show resolved
Hide resolved
src/nunit.analyzers.tests/ClassicModelAssertUsage/AreSameClassicModelAssertUsageCodeFixTests.cs
Outdated
Show resolved
Hide resolved
...nunit.analyzers.tests/ClassicModelAssertUsage/ContainsClassicModelAssertUsageCodeFixTests.cs
Outdated
Show resolved
Hide resolved
@mikkelbu This should now be ready for another review! |
Sorry about leaving this hanging. I'll take a look at this next weekend. |
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.
Looks great. Thanks for this huge effort @Bartleby2718. I'll merge this now
I think this is now ready for review. I had to delete some tests from #160, so I'd appreciate it if anyone could give me specific suggestions on where to improve. I agree that there are some inconsistencies in terms of where I've touched, but I believe I did need all of these to pass all tests.
Thanks in advance!
This fixes #713.