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

[bug][.net analyzer] ignore property bag class with suffix Options #7247

Closed
archerzz opened this issue Nov 7, 2023 · 2 comments · Fixed by #7250
Closed

[bug][.net analyzer] ignore property bag class with suffix Options #7247

archerzz opened this issue Nov 7, 2023 · 2 comments · Fixed by #7250
Assignees
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved.

Comments

@archerzz
Copy link
Member

archerzz commented Nov 7, 2023

Problem

In AZC0030, we will report a warning if a model class name ends with Options. However, our property bag class will have an Options suffix. That causes false alerts, like https://github.com/Azure/azure-sdk-for-net/pull/39653/checks?check_run_id=18337868902

sdk/integrationspaces/Azure.ResourceManager.IntegrationSpaces/src/Generated/Models/BusinessProcessCollectionGetAllOptions.cs(14,26): Error AZC0030: Model name 'BusinessProcessCollectionGetAllOptions' ends with 'Options'. Suggest to rename it to 'BusinessProcessCollectionGetAllConfig' or any other appropriate name.

BusinessProcessCollectionGetAllOptions is a property bag. We should ignore such cases in AZC0030

@archerzz archerzz self-assigned this Nov 7, 2023
archerzz pushed a commit to archerzz/azure-sdk-tools that referenced this issue Nov 7, 2023
- change `GenerlSuffixAnalyzer` to ignore model classes with `Options` suffix if there is no serialization
- add test cases

fix Azure#7247
@archerzz archerzz added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Nov 7, 2023
archerzz added a commit that referenced this issue Nov 8, 2023
* fix(.net analyzer): ignore property bag with `Options` suffix

- change `GenerlSuffixAnalyzer` to ignore model classes with `Options` suffix if there is no serialization
- add test cases

fix #7247

* remov check on public serialization

---------

Co-authored-by: Mingzhe Huang (from Dev Box) <[email protected]>
@shrutijha041100
Copy link
Member

Hi, I am facing the same issue with my model class name ending in "Parameter" ending in the error AZC0030. What can I do?

@archerzz
Copy link
Member Author

archerzz commented Feb 26, 2024

Hi, I am facing the same issue with my model class name ending in "Parameter" ending in the error AZC0030. What can I do?

@shrutijha041100 Ordinary models should avoid Parameter suffix. You can rename the model, see here for details:
https://github.com/Azure/azure-sdk-for-net/blob/176fd476588e8e61ebce747d66714cb39947cae5/sdk/azurestackhci/Azure.ResourceManager.Hci/src/autorest.md?plain=1#L58-L76

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants