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

Add WithNonVoidReturnType #762

Merged
merged 3 commits into from
Jun 15, 2016

Conversation

thomaslevesque
Copy link
Member

@thomaslevesque thomaslevesque commented Jun 14, 2016

Supersedes #674

I left @balazsbonis's commit intact for now so you can see what I changed; I'll squash the first two commits before merge.

Fixes #648

@@ -46,7 +46,6 @@ protected virtual CodeFixProvider GetBasicCodeFixProvider()
/// <param name="newSource">A class in the form of a string after the code fix was applied to it.</param>
/// <param name="codeFixIndex">Index determining which code fix to apply if there are multiple.</param>
/// <param name="allowNewCompilerDiagnostics">A boolean controlling whether or not the test will fail if the code fix introduces other warnings after being applied.</param>
[SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed", Justification = "It's not intended to be a public API, so it doesn't matter")]
Copy link
Member Author

Choose a reason for hiding this comment

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

I disabled this warning in the ruleset for tests, since it only matters for public APIs

@adamralph
Copy link
Contributor

If you squash the first two commits, I presume it will keep @balazsbonis as the author?

@thomaslevesque
Copy link
Member Author

If you squash the first two commits, I presume it will keep @balazsbonis as the author?

I'm almost certain it will, but I'll check before pushing

@adamralph
Copy link
Contributor

adamralph commented Jun 14, 2016

It's academic in this case, since he's not GPG signing his commits, but if he was, that would remove the Verified from his commit. I wonder how we'd handle that case... I'd guess we'd just leave his commit as-is. But then, we wouldn't necessarily be able to rebase it as-is, because of conflicts, and editing those conflicts during rebase would remove the GPP signature too...

@thomaslevesque
Copy link
Member Author

I don't think it's possible to rebase a GPG signed commit, even if there's no conflict, since the SHA1 would be different

@thomaslevesque
Copy link
Member Author

(I mean someone else's commit, of course; you can still rebase your own commit)

@thomaslevesque thomaslevesque force-pushed the withnonvoidreturntype branch 2 times, most recently from a64c1ee to b38bf6f Compare June 14, 2016 23:30
@thomaslevesque
Copy link
Member Author

I made all the changes, including the squash. Thanks for the review!

this.configuration.WithNonVoidReturnType();

// Assert
Assert.That(this.callRule.ApplicableToAllNonVoidReturnTypes, Is.EqualTo(true));
Copy link
Member

Choose a reason for hiding this comment

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

Is this the only reason the property has a getter? I'd be inclined to drop it (and this test) in that case. Of course, that leaves a set-only property, but we could switch to a method.
On the other hand, the property as is does follow the pattern established by ApplicableToMembersWithReturnType, so if it stays as is, I'm okay.

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, it's also read in AnyCallCallRule... but yes, it's the only place outside the class where it's read. It doesn't really bother me, though; IMO, if we can set it, we should be able to get it too.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm fine with it remaining. I'd care more if the type was public, but since it's internal.. meh.

@blairconrad
Copy link
Member

Generally looks good to me. Thanks, @thomaslevesque!

@adamralph adamralph merged commit 295e3db into FakeItEasy:master Jun 15, 2016
@adamralph
Copy link
Contributor

Thanks @thomaslevesque !

@thomaslevesque thomaslevesque deleted the withnonvoidreturntype branch June 15, 2016 07:59
@blairconrad
Copy link
Member

I remembered right after I went up to bed last night. Docs?

@thomaslevesque
Copy link
Member Author

Argh, I keep forgetting...

@thomaslevesque
Copy link
Member Author

I'll send a new PR soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants