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

Fix recent warnings seen on Rider 2024.3 #6443

Merged
merged 3 commits into from
Dec 4, 2024
Merged

Conversation

frenzibyte
Copy link
Member

@frenzibyte frenzibyte commented Dec 4, 2024

Not fully sure if this is caused by new Rider update or something else, I've navigated back to a point before #6434 was merged but it's not relevant, not to mention that the warnings fixed by this PR completely come from ReSharper, so they're not relevant to that PR anyway.

Fix enum naming warnings

This one was actually seen in ppy/osu as well half a year ago: ppy/osu#28051

It seems that it would be better to exclude enum members from naming rule inspections, but apparently that's not possible to do at all. Enum members are being treated the same as public fields/properties, and since we apply the pascal case rule to those, enum members are being affected as well.

This is an issue with Rider that was reported a long while ago but has not been fixed until now. For the time being, any existing enum causing a warning has been individually silenced until Rider responds or otherwise (there are rare enums which renaming them or adding abbreviations to silence them is viable so I've done that for them).

Demote "usage of default struct equality" inspection to hint

Looks to be a new Rider inspection, it's firing off as warnings in the following two places (screenshots were taken after severity was changed to hint):

CleanShot 2024-12-04 at 06 17 33
CleanShot 2024-12-04 at 06 18 04

Made it a hint for now, not confident about touching the source generation codebase just to appease this inspection (@smoogipoo you might be interested though)

@huoyaoyuan
Copy link
Contributor

Made it a hint for now, not confident about touching the source generation codebase just to appease this inspection

FYI: For source generation, the official recommendation is to use records or record structs. The optimal equality operations will be generated by compiler. A supplement definition of IsExternalInit is required (use internal accessibility).

Copy link
Member

@peppy peppy left a comment

Choose a reason for hiding this comment

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

if it works

@peppy peppy merged commit 13e82bd into ppy:master Dec 4, 2024
14 checks passed
@frenzibyte frenzibyte deleted the fix-warnings branch December 4, 2024 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants