Skip to content

Support configurable casing styles in Azure Core - #5602

Merged
Timothee Guerin (timotheeguerin) merged 4 commits into
Azure:mainfrom
timotheeguerin:feat/configurable-casing-styles
Oct 3, 2026
Merged

Timothee Guerin (timotheeguerin) merged 4 commits into
Azure:mainfrom
timotheeguerin:feat/configurable-casing-styles

Conversation

@timotheeguerin

Copy link
Copy Markdown
Member

Services with existing snake_case APIs, such as Foundry, currently have to disable Azure Core's casing-style rule instead of using it to enforce their own conventions. This also prevents shared libraries from packaging an appropriate naming policy in their rulesets.

Allow casing to be configured per declaration category, so a service can require snake_case properties and members while retaining the usual type and operation naming:

linter:
  enable:
    "@azure-tools/typespec-azure-core/casing-style":
      modelProperty: snake_case
      unionVariant: snake_case
      enumMember: snake_case

Each category accepts camelCase, PascalCase, snake_case, or false. Existing defaults and diagnostics are unchanged; additional checks for unions, enums, scalars, and their applicable members are opt-in. Options are schema-validated and can be supplied by a library ruleset or overridden in a service's configuration.

@microsoft-github-policy-service microsoft-github-policy-service Bot added int:azure-specs Run integration tests against azure-rest-api-specs lib:azure-core Issues for @azure-tools/typespec-azure-core library linter Issues related to linter rules labels Oct 1, 2026
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

All changed packages have been documented.

  • ✅ @azure-tools/typespec-azure-core
Show changes

@azure-tools/typespec-azure-core - feature ✏️

Configure casing-style per declaration category, including opt-in snake_case properties,,> operation parameters, union variants, and enum members. Existing Azure defaults remain unchanged.,> ,> yaml,> linter:,> enable:,> "@azure-tools/typespec-azure-core/casing-style":,> modelProperty: snake_case,> union: PascalCase,> unionVariant: snake_case,> enum: PascalCase,> enumMember: snake_case,> scalar: PascalCase,>

@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

📦 Package size report

1 package changed size, +1.07 KB (+0.0%) packed overall.

Package Packed (base → head) Δ Packed Unpacked (base → head) Δ Unpacked
@azure-tools/typespec-azure-core 133.12 KB → 134.19 KB +1.07 KB (+0.8%) 🔴 721.70 KB → 724.18 KB +2.48 KB (+0.3%)
12 package(s) with no notable change
Package Packed (base → head) Δ Packed Unpacked (base → head) Δ Unpacked
@azure-tools/typespec-ts 540.84 KB → 540.83 KB -8 B (-0.0%) 2.60 MB → 2.60 MB -149 B (-0.0%)
@azure-tools/azure-http-specs 148.36 KB → 148.36 KB — 1.17 MB → 1.17 MB —
@azure-tools/typespec-autorest 81.98 KB → 81.98 KB — 400.59 KB → 400.59 KB —
@azure-tools/typespec-autorest-canonical 7.42 KB → 7.42 KB — 26.00 KB → 26.00 KB —
@azure-tools/typespec-azure-portal-core 42.48 KB → 42.48 KB — 193.20 KB → 193.20 KB —
@azure-tools/typespec-azure-resource-manager 184.05 KB → 184.05 KB — 1.11 MB → 1.11 MB —
@azure-tools/typespec-azure-rulesets 5.50 KB → 5.50 KB — 33.67 KB → 33.67 KB —
@azure-tools/typespec-client-generator-core 240.28 KB → 240.28 KB — 1.28 MB → 1.28 MB —
@azure-tools/typespec-go 263.56 KB → 263.56 KB — 1.35 MB → 1.35 MB —
@azure-tools/typespec-java 13.51 MB → 13.51 MB — 15.04 MB → 15.04 MB —
@azure-tools/typespec-metadata 15.91 KB → 15.91 KB — 62.26 KB → 62.26 KB —
@azure-tools/typespec-python 42.22 KB → 42.22 KB — 164.91 KB → 164.91 KB —

Packed = gzipped .tgz published to npm. Unpacked = total extracted size. 🆕 added, 🗑️ removed. Packages from the core/ submodule are not included.
🔴 grew · 🟢 shrank — only changes of at least 512 B and 0.5% are marked.

@pkg-pr-new

pkg-pr-new Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@azure-tools/typespec-azure-core@5602

commit: 1550030

@azure-sdk-automation

Copy link
Copy Markdown
Contributor

You can try these changes here

🛝 Playground 🌐 Website

Comment thread packages/typespec-azure-core/src/rules/casing-style.md

@catalinaperalta catalinaperalta left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm, just one doc improvement

@timotheeguerin
Timothee Guerin (timotheeguerin) marked this pull request as ready for review October 2, 2026 17:58
Merged via the queue into Azure:main with commit c9efd4a Oct 3, 2026
43 of 44 checks passed
@timotheeguerin
Timothee Guerin (timotheeguerin) deleted the feat/configurable-casing-styles branch October 3, 2026 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

int:azure-specs Run integration tests against azure-rest-api-specs lib:azure-core Issues for @azure-tools/typespec-azure-core library linter Issues related to linter rules

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants