Skip to content

Add new analyzer for unused results - #13

Open
pobiega wants to merge 1 commit into
Remora:mainfrom
pobiega:useResultAnalyzer
Open

Add new analyzer for unused results#13
pobiega wants to merge 1 commit into
Remora:mainfrom
pobiega:useResultAnalyzer

Conversation

@pobiega

@pobiega pobiega commented May 6, 2023

Copy link
Copy Markdown

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.

@TheBrambleShark

Copy link
Copy Markdown
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
Copy Markdown

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

@Nihlus

Nihlus commented May 27, 2023

Copy link
Copy Markdown
Member

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

@Nihlus

Nihlus commented Jan 2, 2025

Copy link
Copy Markdown
Member

What's the status of this PR?

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