feat(analyzer): add rules regarding model name suffixes#6916
Merged
archerzz merged 21 commits intoAzure:mainfrom Oct 26, 2023
Merged
feat(analyzer): add rules regarding model name suffixes#6916archerzz merged 21 commits intoAzure:mainfrom
archerzz merged 21 commits intoAzure:mainfrom
Conversation
- add four rules checking the suffixes of model names - upgrade Roslyn to latest version since new rules require some API - minor refactor existing codes - add test cases for the new rules resolve Azure#6905
eafaee9 to
94bfbb0
Compare
94bfbb0 to
2e313f4
Compare
Member
Author
|
preview pr on @m-nash ^^ |
christothes
reviewed
Sep 7, 2023
| { | ||
| protected static readonly string Title = "Improper model name suffix"; | ||
| protected static readonly string Description = "Suffix is not recommended. Consider to remove or modify it."; | ||
| protected static readonly string GeneralRenamingMessageFormat = "Model name '{0}' ends with '{1}'. Suggest to rename it to an appropriate name."; |
Member
There was a problem hiding this comment.
Should this link to our guidelines that specify the naming rules we are enforcing here?
Member
Author
There was a problem hiding this comment.
I could not find the official guidelines. We do have a OneNote page on that. @m-nash Shall we update the .NET Azure SDK Design Guidelines?
Member
Author
There was a problem hiding this comment.
Or we can do something like StyleCop.
- For each diagnostic ID, we create a page, like https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA0001.md
- In each page, we provide explanation of the diagnostic, and provide mitigation solution.
...otnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers/ModelName/GeneralSuffixAnalyzer.cs
Outdated
Show resolved
Hide resolved
src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers/ModelName/SuffixAnalyzerBase.cs
Outdated
Show resolved
Hide resolved
src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers/ModelName/SuffixAnalyzerBase.cs
Outdated
Show resolved
Hide resolved
m-nash
reviewed
Sep 7, 2023
src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers.Tests/ModelName/AZC0030Tests.cs
Outdated
Show resolved
Hide resolved
src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers/AnalyzerUtils.cs
Outdated
Show resolved
Hide resolved
src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers/ModelName/SuffixAnalyzerBase.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Christopher Scott <chriscott@hotmail.com>
Member
Author
|
@christothes @m-nash Changes after last review:
Updated preview PR on
|
m-nash
approved these changes
Sep 20, 2023
christothes
approved these changes
Sep 20, 2023
src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers/AnalyzerUtils.cs
Outdated
Show resolved
Hide resolved
src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers/INameSpaceSymbolExtensions.cs
Outdated
Show resolved
Hide resolved
added 4 commits
October 25, 2023 12:01
# Conflicts: # src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers/Descriptors.cs
Member
Author
|
Changes since last review:
Preview PR: Azure/azure-sdk-for-net#39518 It's the same as the previous one, except that analyzer package is the latest. |
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.
resolve #6905