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

Azure Core: Enable no-enum rule by default in all ruleset #467

Merged
merged 7 commits into from
Mar 22, 2024

Conversation

timotheeguerin
Copy link
Member

No description provided.

@timotheeguerin timotheeguerin changed the title Enable no-enum rule Azure Core: Enable no-enum rule by default in all ruleset Mar 21, 2024
@azure-sdk
Copy link
Collaborator

azure-sdk commented Mar 21, 2024

All changed packages have been documented.

@azure-sdk
Copy link
Collaborator

@timotheeguerin timotheeguerin enabled auto-merge (squash) March 22, 2024 02:35
@timotheeguerin timotheeguerin merged commit 8046715 into Azure:main Mar 22, 2024
14 checks passed
@timotheeguerin timotheeguerin deleted the enable-no-enum-rule branch March 22, 2024 03:05
@@ -46,6 +47,27 @@ describe("typespec-azure-core: no-enum rule", () => {
.toBeValid();
});

it("emit warning about other enums in versioned service", async () => {
Copy link
Contributor

@MaryGao MaryGao Mar 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am wondering why we have this warning in azure scope?

Looking at the swagger, there are a lot of cases where "modelAsString": false in enum extensible and I think they would be taken as fixed.
https://github.com/Azure/azure-rest-api-specs/blob/feature/health-lro/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/preview/2020-10-01-preview/cloudService.json#L1483-L1492

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Being an azure scope is the entire point of this linting rule. Actual enums cannot deal with new values being added so azure policy is you shouldn’t use them. There is of course always exceptions.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants