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 new analyzer for unused results #13

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pobiega
Copy link

@pobiega pobiega commented May 6, 2023

fixes #6

As demonstrated by the unittests, it should raise diagnostics warnings for unused results returned from called methods. Tried following the remora code style, but feel free to adjust anything you find out of line.

Also feel free to reach out on the C# discord if there is anything you wish to discuss about this.

@Foxtrek64
Copy link
Sponsor Contributor

Looks good!
One small nit though is that if we wrap function/constructor calls we have historically emulated allman-style indentation. I'm not sure off the top of my head if that includes if statements but I imagine it would if just for consistency.

@Rutherther
Copy link

What about adding the warnings to not used IResult as well?

@Nihlus
Copy link
Member

Nihlus commented May 27, 2023

I agree with both @Foxtrek64 and @Rutherther here, otherwise things look good. Happy to merge if you fix/add those two things.

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.

Analyzer for failing to use a Result
4 participants