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

RCS1213 flags Unity callbacks, ignoring .editorconfig #1596

Closed
lucypero opened this issue Dec 11, 2024 · 3 comments
Closed

RCS1213 flags Unity callbacks, ignoring .editorconfig #1596

lucypero opened this issue Dec 11, 2024 · 3 comments

Comments

@lucypero
Copy link

I want to enable RCS1213 on Default.ruleset. This way, the warning is actually enforced by Unity, and it won't let you compile.

The problem is that Unity is ignoring whatever I have in .editorconfig. dotnet format also ignores it.

I have this in .editorconfig:

# Enable code analysis to detect Unity-specific code
roslynator_unity_code_analysis.enabled = true

So how can I configure Roslynator in a way that my configuration is taken into account by Unity and dotnet format?

@josefpihrt
Copy link
Collaborator

Is it possible that editorconfig file is misconfigured or that it has invalid format? Could you share your editorconfig file?

@lucypero
Copy link
Author

Update: VS Code does take .editorconfig into account. dotnet format too. My mistake.

One problem is that there's a few false positives. It flags OnValidate(), for example. We solve it by making the method protected.

Still, Unity doesn't take this into account if I enable the warning in Default.ruleset. It flags all Unity callbacks. But that's fine. dotnet format should be enough.

@josefpihrt
Copy link
Collaborator

@lucypero Can this issue be closed then?

@lucypero lucypero closed this as completed Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants