Add no-url-suffix linter rule - #4541
Conversation
ee45b72 to
42061ef
Compare
|
All changed packages have been documented.
Show changes
|
42061ef to
8041bab
Compare
commit: |
|
You can try these changes here
|
⚡ Benchmark Results
Full details – comparing
|
| Metric | Baseline | Current | Change |
|---|---|---|---|
| total | 🔴 672.2ms | 🔴 973.1ms | +44.8% 🔴 |
| loader | 🟢 190.4ms | 🟡 287.9ms | +51.2% 🔴 |
| resolver | 🟢 18.7ms | 🟢 40.9ms | +119.2% 🔴 |
| checker | 🟡 209.3ms | 🟡 353.4ms | +68.9% 🔴 |
| validation | 🟢 46.6ms | 🟢 85.9ms | +84.6% 🔴 |
| ↳ validation/@azure-tools/typespec-azure-core | 🟢 6.9ms | 🟡 11.8ms | +72.1% 🔴 |
| ↳ validation/@typespec/http | 🟢 6.1ms | 🟡 15.1ms | +145.8% 🔴 |
| ↳ validation/@typespec/rest | 🟢 0.6ms | 🟢 1.7ms | +172.5% 🔴 |
| ↳ validation/@typespec/versioning | 🔴 30.7ms | 🔴 53.2ms | +73.2% 🔴 |
| ↳ validation/compiler | 🟢 1.7ms | 🟢 4.0ms | +132.3% 🔴 |
| linter | 🟢 148.7ms | 🟡 204.6ms | +37.6% 🔴 |
| ↳ linter/@azure-tools/typespec-azure-core/auth-required | 🟢 0.0ms | 🟢 0.1ms | +375.8% |
| ↳ linter/@azure-tools/typespec-azure-core/bad-record-type | 🟢 0.2ms | 🟢 0.6ms | +156.0% |
| ↳ linter/@azure-tools/typespec-azure-core/byos | 🟢 6.2ms | 🟢 8.1ms | +29.8% 🔴 |
| ↳ linter/@azure-tools/typespec-azure-core/casing-style | 🟢 0.6ms | 🟢 1.4ms | +124.2% |
| ↳ linter/@azure-tools/typespec-azure-core/composition-over-inheritance | 🟢 0.1ms | 🟢 0.2ms | +148.1% |
| ↳ linter/@azure-tools/typespec-azure-core/documentation-required | 🟢 0.9ms | 🟢 1.9ms | +118.0% 🔴 |
| ↳ linter/@azure-tools/typespec-azure-core/friendly-name | 🟢 0.6ms | 🟢 1.4ms | +115.1% |
| ↳ linter/@azure-tools/typespec-azure-core/key-visibility-required | 🟢 0.2ms | 🟢 0.4ms | +106.3% |
| ↳ linter/@azure-tools/typespec-azure-core/known-encoding | 🟢 0.3ms | 🟢 0.5ms | +53.5% |
| ↳ linter/@azure-tools/typespec-azure-core/long-running-polling-operation-required | 🟢 0.3ms | 🟢 0.8ms | +157.6% |
| ↳ linter/@azure-tools/typespec-azure-core/no-case-mismatch | 🟢 0.3ms | 🟢 0.7ms | +174.1% |
| ↳ linter/@azure-tools/typespec-azure-core/no-closed-literal-union | 🟢 0.3ms | 🟢 1.0ms | +251.1% |
| ↳ linter/@azure-tools/typespec-azure-core/no-enum | 🟢 0.0ms | 🟢 0.2ms | +430.6% |
| ↳ linter/@azure-tools/typespec-azure-core/no-error-status-codes | 🟢 0.1ms | 🟢 0.3ms | +167.0% |
| ↳ linter/@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops | 🟢 0.1ms | 🟢 0.2ms | +67.4% |
| ↳ linter/@azure-tools/typespec-azure-core/no-format | 🟢 0.6ms | 🟢 0.8ms | +45.2% |
| ↳ linter/@azure-tools/typespec-azure-core/no-generic-numeric | 🟢 0.4ms | 🟢 0.9ms | +90.8% |
| ↳ linter/@azure-tools/typespec-azure-core/no-header-explode | 🔴 20.4ms | 🔴 24.6ms | +20.5% 🔴 |
| ↳ linter/@azure-tools/typespec-azure-core/no-legacy-usage | 🟢 1.2ms | 🟢 1.9ms | +60.8% |
| ↳ linter/@azure-tools/typespec-azure-core/no-multiple-discriminator | 🟢 0.1ms | 🟢 0.2ms | +136.0% |
| ↳ linter/@azure-tools/typespec-azure-core/no-nullable | 🟢 0.3ms | 🟢 0.4ms | +54.8% |
| ↳ linter/@azure-tools/typespec-azure-core/no-offsetdatetime | 🟢 1.2ms | 🟢 1.9ms | +51.7% |
| ↳ linter/@azure-tools/typespec-azure-core/no-openapi | 🟢 2.0ms | 🟢 2.3ms | +14.0% |
| ↳ linter/@azure-tools/typespec-azure-core/no-private-usage | 🟢 2.0ms | 🟢 3.0ms | +50.6% 🔴 |
| ↳ linter/@azure-tools/typespec-azure-core/no-query-explode | 🔴 21.5ms | 🔴 25.4ms | +18.2% 🔴 |
| ↳ linter/@azure-tools/typespec-azure-core/no-response-body | 🔴 25.4ms | 🔴 31.5ms | +24.0% 🔴 |
| ↳ linter/@azure-tools/typespec-azure-core/no-rest-library-interfaces | 🟢 0.0ms | 🟢 0.1ms | +361.3% |
| ↳ linter/@azure-tools/typespec-azure-core/no-route-parameter-name-mismatch | 🟢 5.4ms | 🟢 7.0ms | +30.3% 🔴 |
| ↳ linter/@azure-tools/typespec-azure-core/no-rpc-path-params | 🟢 0.2ms | 🟢 0.4ms | +83.7% |
| ↳ linter/@azure-tools/typespec-azure-core/no-string-discriminator | 🟢 0.0ms | 🟢 0.1ms | +171.4% |
| ↳ linter/@azure-tools/typespec-azure-core/no-unknown | 🟢 0.2ms | 🟢 0.3ms | +65.7% |
| ↳ linter/@azure-tools/typespec-azure-core/no-unnamed-union | 🟢 0.4ms | 🟢 0.8ms | +109.5% |
| ↳ linter/@azure-tools/typespec-azure-core/operation-missing-api-version | 🟢 0.2ms | 🟢 0.4ms | +110.6% |
| ↳ linter/@azure-tools/typespec-azure-core/request-body-problem | 🟢 0.3ms | 🟢 0.5ms | +52.5% |
| ↳ linter/@azure-tools/typespec-azure-core/require-versioned | 🟢 0.0ms | 🟢 0.1ms | +554.0% |
| ↳ linter/@azure-tools/typespec-azure-core/response-schema-problem | 🔴 23.5ms | 🔴 30.9ms | +31.5% 🔴 |
| ↳ linter/@azure-tools/typespec-azure-core/rpc-operation-request-body | 🟢 0.3ms | 🟢 0.7ms | +99.9% |
| ↳ linter/@azure-tools/typespec-azure-core/spread-discriminated-model | 🟢 0.3ms | 🟢 0.4ms | +60.0% |
| ↳ linter/@azure-tools/typespec-azure-core/use-standard-names | 🟢 5.8ms | 🟢 6.9ms | +19.3% 🔴 |
| ↳ linter/@azure-tools/typespec-azure-core/use-standard-operations | 🟢 0.1ms | 🟢 0.2ms | +94.0% |
| ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-agent-base-type-child-resources | 🟢 4.5ms | 🔴 21.0ms | +369.1% 🔴 |
| ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-agent-base-type-lifecycle-operations | 🟢 0.0ms | 🟢 0.3ms | +2823.6% |
| ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-common-types-version | 🟢 4.4ms | 🟡 11.7ms | +166.3% 🔴 |
| ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-custom-resource-no-key | 🟢 0.1ms | 🟢 0.2ms | +127.9% |
| ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-custom-resource-usage-discourage | 🟢 0.1ms | 🟢 0.1ms | +95.1% |
| ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-delete-operation-response-codes | 🟢 1.5ms | 🟢 6.8ms | +369.5% 🔴 |
| ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-no-path-casing-conflicts | 🟢 9.8ms | 🟡 16.8ms | +72.2% 🔴 |
| ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-no-record | 🟢 0.4ms | 🟢 0.6ms | +76.1% |
| ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-post-operation-response-codes | 🟢 0.5ms | 🟢 1.3ms | +150.0% |
| ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes | 🟢 0.0ms | 🟢 0.2ms | +1062.3% |
| ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-action-no-segment | 🟢 0.2ms | 🟢 0.4ms | +81.7% |
| ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-duplicate-property | 🟢 0.1ms | 🟢 0.4ms | +184.3% |
| ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator | 🟢 0.0ms | 🟢 0.1ms | +502.6% |
| ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-action-verb | 🟢 0.1ms | 🟢 0.2ms | +103.7% |
| ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property | 🟢 0.1ms | 🟢 0.2ms | +151.0% |
| ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-version-format | 🟢 0.0ms | 🟢 0.2ms | +400.3% |
| ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-key-invalid-chars | 🟢 0.3ms | 🟢 0.5ms | +78.7% |
| ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-name-pattern | 🟢 0.0ms | 🟢 0.1ms | +905.7% |
| ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-operation | 🟢 0.2ms | 🟢 0.5ms | +218.6% |
| ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-operation-response | 🟢 5.2ms | 🟢 8.5ms | +64.7% 🔴 |
| ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-patch | 🟢 0.3ms | 🟢 0.9ms | +184.7% |
| ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-path-segment-invalid-chars | 🟢 0.2ms | 🟢 0.4ms | +91.0% |
| ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state | 🟢 0.1ms | 🟢 0.4ms | +279.4% |
| ↳ linter/@azure-tools/typespec-azure-resource-manager/beyond-nesting-levels | 🟢 0.1ms | 🟢 0.2ms | +148.9% |
| ↳ linter/@azure-tools/typespec-azure-resource-manager/empty-updateable-properties | 🟢 0.2ms | 🟢 0.4ms | +150.0% |
| ↳ linter/@azure-tools/typespec-azure-resource-manager/improper-subscription-list-operation | 🟢 0.0ms | 🟢 0.1ms | +1787.4% |
| ↳ linter/@azure-tools/typespec-azure-resource-manager/lro-location-header | 🟡 14.5ms | 🟡 17.9ms | +23.3% 🔴 |
| ↳ linter/@azure-tools/typespec-azure-resource-manager/missing-operations-endpoint | 🟢 0.0ms | 🟢 0.1ms | +461.9% |
| ↳ linter/@azure-tools/typespec-azure-resource-manager/missing-x-ms-identifiers | 🟢 0.3ms | 🟢 1.0ms | +236.6% |
| ↳ linter/@azure-tools/typespec-azure-resource-manager/no-empty-model | 🟢 0.1ms | 🟢 0.3ms | +86.1% |
| ↳ linter/@azure-tools/typespec-azure-resource-manager/no-override-props | 🟢 0.1ms | 🟢 0.3ms | +348.5% |
| ↳ linter/@azure-tools/typespec-azure-resource-manager/no-resource-delete-operation | 🟢 0.2ms | 🟢 0.4ms | +116.0% |
| ↳ linter/@azure-tools/typespec-azure-resource-manager/no-response-body | 🔴 21.5ms | 🔴 27.8ms | +29.3% 🔴 |
| ↳ linter/@azure-tools/typespec-azure-resource-manager/patch-envelope | 🟢 0.1ms | 🟢 0.4ms | +156.4% |
| ↳ linter/@azure-tools/typespec-azure-resource-manager/resource-name | 🟢 0.2ms | 🟢 0.4ms | +173.8% |
| ↳ linter/@azure-tools/typespec-azure-resource-manager/secret-prop | 🟢 3.8ms | 🟢 5.6ms | +46.4% 🔴 |
| ↳ linter/@azure-tools/typespec-azure-resource-manager/unsupported-type | 🟢 0.4ms | 🟢 0.7ms | +75.1% |
| ↳ linter/@azure-tools/typespec-azure-resource-manager/version-progression | 🟢 0.0ms | 🟢 0.3ms | +845.5% |
| ↳ linter/@azure-tools/typespec-client-generator-core/property-name-conflict | 🟢 1.1ms | 🟢 2.3ms | +98.7% 🔴 |
| ↳ linter/@azure-tools/typespec-client-generator-core/require-client-suffix | 🟢 0.2ms | 🟢 1.6ms | +659.8% 🔴 |
| emit | 🔴 5.59s | 🔴 5.80s | +3.6% |
| ↳ emit/@Azure-Tools | 🟢 0.0ms | 🟢 0.0ms | +0.0% |
| ↳ emit/@azure-tools/typespec-autorest | 🟢 84.0ms | 🟢 123.0ms | +46.5% 🔴 |
| ↳ emit/@azure-tools/typespec-python | 🔴 2.15s | 🔴 2.15s | -0.1% |
| ↳ emit/@typespec | 🟢 0.0ms | 🟢 0.0ms | +0.0% |
| ↳ emit/@typespec/http-client-js | 🔴 471.9ms | 🔴 557.3ms | +18.1% 🔴 |
| ↳ emit/@typespec/openapi3 | 🟢 76.4ms | 🟢 104.5ms | +36.8% 🔴 |
| ↳ emit/@typespec/openapi3/compute | 🟢 66.6ms | 🟢 90.8ms | +36.4% 🔴 |
| ↳ emit/@typespec/openapi3/write | 🟢 9.5ms | 🟢 13.4ms | +40.8% 🔴 |
Averaged across 3 specs (azure-arm-resource-manager, azure-core-dataplane, azure-full).
Threshold: changes > ±5% are highlighted.
🟢 Fast · 🟡 Moderate (stages >200ms, rules >10ms) · 🔴 Slow (stages >400ms, rules >20ms)
53343bc to
0569c91
Compare
|
so yes this is why i have split #4564 into multiple phases. THe last 6 services will require more change and we might want to disable the rules for them until we have them migrated but this would allow the many others from benfiting from it from next release |
|
Thanks for the clarification. I do think if we need to push forward with those 6 specs opted out in the short term lets do that as this will be a pretty big win for our partner teams to get the signal with an auto fixer at the earliest stage possible. |
Keep generated client.tsp using statements after existing imports when applying C# clientName codefixes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use parsed client.tsp statements to place generated imports and usings instead of scanning text lines. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Liftr service team has mentioned that CI failures in generated .NET SDK PRs are a key pain point in their release process, highlighting the need for earlier validation. |
Create a dedicated `client-sdk` ruleset and enable `csharp-no-url-suffix` in it, instead of `resource-manager` and `data-plane`. This scopes the rule to specs that emit a client SDK (those extending the `client-sdk` ruleset) rather than applying it to every ARM/data-plane spec. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Verify the new client-sdk ruleset enables the C# URL suffix rule. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…4792) Hotfix patch release cherry-picking #4541 ("Add no-url-suffix linter rule") onto `release/june-2026`. ## Packages - `@azure-tools/typespec-client-generator-core` → **0.69.2** - `@azure-tools/typespec-azure-rulesets` → **0.69.2** ## Changes - Cherry-pick of #4541 (squash-merge commit `aac448e`); changeKind set to `fix` for a patch bump - Version bump: tcgc & rulesets `0.69.1` → `0.69.2` ## Notes - Targets `release/june-2026` (NOT `main`) - Only tcgc + rulesets are affected; the 5 pre-existing pending change files (private website/benchmark packages) are untouched - `core` submodule pointer unchanged - Backmerge to `main` to follow after merge --------- Co-authored-by: Haiyuan Zhang <haiyzhan@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add csharp-no-url-suffix linter rule documentation (PR Azure#4541) - New rule doc: typespec-client-generator-core/rules/csharp-no-url-suffix.md - Updated TCGC linter reference to include the new rule - Updated typespec-azure-rulesets linter reference to include client-sdk ruleset - Update ARM library reference docs with improved descriptions (PR Azure#4494) - data-types.md: Add missing descriptions for ARM response types and models - decorators.md: Fix typo in @armLibraryNamespace, fix @armProviderNameValue description, add descriptions for @armResourceAction, @armResourceCollectionAction, @armResourceCreateOrUpdate, @armResourceDelete, @armResourceList, @armResourceRead, @armResourceUpdate, @armVirtualResource, and @resourceBaseType - interfaces.md: Add descriptions for composite operation interfaces and individual operation signatures throughout Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sync documentation from Azure/typespec-azure upstream main branch. Key changes included: - Add docs for new ARM linter rule `no-reserved-resource-property` (PR Azure#4842) - Add docs for new TCGC linter rule `csharp-no-url-suffix` (PR Azure#4541) - Add ARM agent base type rules docs: `arm-agent-base-type-child-resources`, `arm-agent-base-type-lifecycle-operations`, `no-override-props` - Update ARM `data-types.md`: align Agent ResponseStatus enum to PascalCase and `createdAt` to utcDateTime per ARM guidelines (PR Azure#4855) - Fix `@azureBaseType` decorator doc example (PR Azure#4755) - Improve ARM library decorators, interfaces, and models docs (PR Azure#4494) - Add TCGC `@override` path-param and `@clientLocation` type-conflict caution admonitions to howto (PR Azure#4844) - Regen Java emitter docs with default values and improved type info (PR Azure#4863) - Update Python emitter docs with new `typeddict` models mode (upstream) - Update TypeScript emitter reference docs - Update autorest and autorest-canonical emitter docs - Update azure-rulesets linter reference - Update azure-core, azure-portal-core, TCGC reference docs - Update howtos for ARM and Generate client libraries - Add release notes for 2026-06-09 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Closes #4561
Add
dotnet-no-url-suffixlinter rule that flags model properties ending withUrland suggests usingUrisuffix instead, to follow .NET SDK naming conventions.