Support for nuget package with multiple Roslyn version analyzers#616
Merged
JoC0de merged 11 commits intoGlitchEnzo:masterfrom Mar 3, 2024
Merged
Support for nuget package with multiple Roslyn version analyzers#616JoC0de merged 11 commits intoGlitchEnzo:masterfrom
JoC0de merged 11 commits intoGlitchEnzo:masterfrom
Conversation
popara96
reviewed
Jan 18, 2024
igor84
reviewed
Jan 18, 2024
| if (!enabledRoslynVersions.Contains(assetRoslynVersion) || | ||
| string.CompareOrdinal(assetRoslynVersion, enabledRoslynVersions.Max()) < 0) | ||
| { | ||
| AssetDatabase.SetLabels(plugin, new[] { ProcessedLabel }); |
Collaborator
There was a problem hiding this comment.
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.
igor84
approved these changes
Jan 25, 2024
popara96
approved these changes
Jan 30, 2024
JoC0de
requested changes
Feb 9, 2024
Collaborator
JoC0de
left a comment
There was a problem hiding this comment.
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
JoC0de
approved these changes
Mar 3, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
To address the #615, I added a process to prevent the same analyzer from being enabled more than once.
It works as follows.
analyzers/dotnetsubfolders are not split into versions, then it remains the same.RoslynAnalyzerlabel.