-
Notifications
You must be signed in to change notification settings - Fork 329
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
Support for nuget package with multiple Roslyn version analyzers #616
Conversation
if (!enabledRoslynVersions.Contains(assetRoslynVersion) || | ||
string.CompareOrdinal(assetRoslynVersion, enabledRoslynVersions.Max()) < 0) | ||
{ | ||
AssetDatabase.SetLabels(plugin, new[] { ProcessedLabel }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of setting and then removing the label, just save in some bool variable if RoslynAnalyzer label should be added and then in the end just SetLabels once to proper value depending on that bool.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution.
I still don't understand why Unity doesn't handle this by itself but at least we can fix it 😃
… add unit test for package with multiple roslyn analyzers
To address the #615, I added a process to prevent the same analyzer from being enabled more than once.
It works as follows.
analyzers/dotnet
subfolders are not split into versions, then it remains the same.RoslynAnalyzer
label.