@azure-tools/typespec-azure-core 0.74.0-dev.2 → 0.74.0-dev.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -52,6 +52,7 @@ Available ruleSets:
52
52
  | [`@azure-tools/typespec-azure-core/no-openapi`](https://azure.github.io/typespec-azure/docs/libraries/azure-core/rules/no-openapi) | Azure specs should not be using decorators from @typespec/openapi or @azure-tools/typespec-autorest |
53
53
  | [`@azure-tools/typespec-azure-core/no-unnamed-types`](https://azure.github.io/typespec-azure/docs/libraries/azure-core/rules/no-unnamed-types) | Azure services should not have anonymous models, union expressions, enum expressions, or scalar expressions. Define them as named declarations. |
54
54
  | [`@azure-tools/typespec-azure-core/no-header-explode`](https://azure.github.io/typespec-azure/docs/libraries/azure-core/rules/no-header-explode) | It is recommended to serialize header parameter without explode: true |
55
+ | [`@azure-tools/typespec-azure-core/no-redundant-summary`](https://azure.github.io/typespec-azure/docs/libraries/azure-core/rules/no-redundant-summary) | Summary must not repeat the documentation. |
55
56
  | [`@azure-tools/typespec-azure-core/no-format`](https://azure.github.io/typespec-azure/docs/libraries/azure-core/rules/no-format) | Azure services should not use the `@format` decorator. |
56
57
  | [`@azure-tools/typespec-azure-core/no-multiple-discriminator`](https://azure.github.io/typespec-azure/docs/libraries/azure-core/rules/no-multiple-discriminator) | Classes should have at most one discriminator. |
57
58
  | [`@azure-tools/typespec-azure-core/no-rest-library-interfaces`](https://azure.github.io/typespec-azure/docs/libraries/azure-core/rules/no-rest-library-interfaces) | Resource interfaces from the TypeSpec.Rest.Resource library are incompatible with Azure.Core. |
@@ -1 +1 @@
1
- {"version":3,"file":"linter.d.ts","sourceRoot":"","sources":["../../src/linter.ts"],"names":[],"mappings":"AA2FA,eAAO,MAAM,OAAO,+CASlB,CAAC"}
1
+ {"version":3,"file":"linter.d.ts","sourceRoot":"","sources":["../../src/linter.ts"],"names":[],"mappings":"AA6FA,eAAO,MAAM,OAAO,+CASlB,CAAC"}
@@ -23,6 +23,7 @@ import { noOpenapiClientExtensionsRule } from "./rules/no-openapi-client-extensi
23
23
  import { noOpenAPIRule } from "./rules/no-openapi.js";
24
24
  import { noPrivateUsage } from "./rules/no-private-usage.js";
25
25
  import { noQueryExplodeRule } from "./rules/no-query-explode.js";
26
+ import { noRedundantSummaryRule } from "./rules/no-redundant-summary.js";
26
27
  import { noResponseBodyRule } from "./rules/no-response-body.js";
27
28
  import { noRouteParameterNameMismatchRule } from "./rules/no-route-parameter-name-mismatch.js";
28
29
  import { noRpcPathParamsRule } from "./rules/no-rpc-path-params.js";
@@ -66,6 +67,7 @@ const rules = [
66
67
  noOpenAPIRule,
67
68
  noUnnamedTypesRule,
68
69
  noHeaderExplodeRule,
70
+ noRedundantSummaryRule,
69
71
  preventFormatRule,
70
72
  noMultipleDiscriminatorRule,
71
73
  preventRestLibraryInterfaces,
@@ -1 +1 @@
1
- {"version":3,"file":"linter.js","sourceRoot":"","sources":["../../src/linter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,8BAA8B,EAAE,MAAM,yCAAyC,CAAC;AACzF,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,4CAA4C,EAAE,MAAM,kCAAkC,CAAC;AAChG,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EA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EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAE3E,MAAM,KAAK,GAAG;IACZ,cAAc;IACd,gBAAgB;IAChB,aAAa;IACb,QAAQ;IACR,UAAU;IACV,8BAA8B;IAC9B,aAAa;IACb,iBAAiB;IACjB,4CAA4C;IAC5C,kBAAkB;IAClB,wBAAwB;IACxB,UAAU;IACV,sBAAsB;IACtB,2BAA2B;IAC3B,yBAAyB;IACzB,oBAAoB;IACpB,cAAc;IACd,oBAAoB;IACpB,kBAAkB;IAClB,mBAAmB;IACnB,aAAa;IACb,kBAAkB;IAClB,mBAAmB;IACnB,sBAAsB;IACtB,iBAAiB;IACjB,2BAA2B;IAC3B,4BAA4B;IAC5B,kBAAkB;IAClB,iBAAiB;IACjB,oBAAoB;IACpB,oBAAoB;IACpB,iCAAiC;IACjC,2BAA2B;IAC3B,4BAA4B;IAC5B,gBAAgB;IAChB,qBAAqB;IACrB,yBAAyB;IACzB,oBAAoB;IACpB,gBAAgB;IAChB,cAAc;IACd,aAAa;IACb,kBAAkB;IAClB,gCAAgC;IAChC,6BAA6B;CAC9B,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,YAAY,CAAC;IAClC,KAAK;IACL,QAAQ,EAAE;QACR,sBAAsB,EAAE;YACtB,MAAM,EAAE;gBACN,CAAC,oCAAoC,yBAAyB,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI;aAC7E;SACF;KACF;CACF,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const noRedundantSummaryRule: import("@typespec/compiler").LinterRuleDefinition<"no-redundant-summary", {
2
+ readonly default: "The summary and documentation are identical. Add detail to the documentation or omit the redundant summary.";
3
+ }, Record<string, never>>;
4
+ //# sourceMappingURL=no-redundant-summary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-redundant-summary.d.ts","sourceRoot":"","sources":["../../../src/rules/no-redundant-summary.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,sBAAsB;;yBAmCjC,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { createRule, fileRef, getDoc, getSummary } from "@typespec/compiler";
2
+ export const noRedundantSummaryRule = createRule({
3
+ name: "no-redundant-summary",
4
+ docs: fileRef.fromPackageRoot("src/rules/no-redundant-summary.md"),
5
+ description: "Summary must not repeat the documentation.",
6
+ severity: "warning",
7
+ url: "https://azure.github.io/typespec-azure/docs/libraries/azure-core/rules/no-redundant-summary",
8
+ messages: {
9
+ default: "The summary and documentation are identical. Add detail to the documentation or omit the redundant summary.",
10
+ },
11
+ create(context) {
12
+ function checkSummary(target) {
13
+ const summary = getSummary(context.program, target);
14
+ const doc = getDoc(context.program, target);
15
+ if (!summary || !doc || summary.trim() !== doc.trim()) {
16
+ return;
17
+ }
18
+ context.reportDiagnostic({ target });
19
+ }
20
+ return {
21
+ namespace: checkSummary,
22
+ interface: checkSummary,
23
+ operation: checkSummary,
24
+ model: checkSummary,
25
+ modelProperty: checkSummary,
26
+ scalar: checkSummary,
27
+ enum: checkSummary,
28
+ enumMember: checkSummary,
29
+ union: checkSummary,
30
+ unionVariant: checkSummary,
31
+ };
32
+ },
33
+ });
34
+ //# sourceMappingURL=no-redundant-summary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-redundant-summary.js","sourceRoot":"","sources":["../../../src/rules/no-redundant-summary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAa,MAAM,oBAAoB,CAAC;AAExF,MAAM,CAAC,MAAM,sBAAsB,GAAG,UAAU,CAAC;IAC/C,IAAI,EAAE,sBAAsB;IAC5B,IAAI,EAAE,OAAO,CAAC,eAAe,CAAC,mCAAmC,CAAC;IAClE,WAAW,EAAE,4CAA4C;IACzD,QAAQ,EAAE,SAAS;IACnB,GAAG,EAAE,6FAA6F;IAClG,QAAQ,EAAE;QACR,OAAO,EACL,6GAA6G;KAChH;IACD,MAAM,CAAC,OAAO;QACZ,SAAS,YAAY,CAAC,MAAY;YAChC,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YACpD,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YAE5C,IAAI,CAAC,OAAO,IAAI,CAAC,GAAG,IAAI,OAAO,CAAC,IAAI,EAAE,KAAK,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC;gBACtD,OAAO;YACT,CAAC;YAED,OAAO,CAAC,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;QACvC,CAAC;QAED,OAAO;YACL,SAAS,EAAE,YAAY;YACvB,SAAS,EAAE,YAAY;YACvB,SAAS,EAAE,YAAY;YACvB,KAAK,EAAE,YAAY;YACnB,aAAa,EAAE,YAAY;YAC3B,MAAM,EAAE,YAAY;YACpB,IAAI,EAAE,YAAY;YAClB,UAAU,EAAE,YAAY;YACxB,KAAK,EAAE,YAAY;YACnB,YAAY,EAAE,YAAY;SAC3B,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azure-tools/typespec-azure-core",
3
- "version": "0.74.0-dev.2",
3
+ "version": "0.74.0-dev.4",
4
4
  "author": "Microsoft Corporation",
5
5
  "description": "TypeSpec Azure Core library",
6
6
  "homepage": "https://azure.github.io/typespec-azure",
@@ -62,8 +62,8 @@
62
62
  "@typespec/http": "^1.17.0",
63
63
  "@typespec/openapi": "^1.17.0",
64
64
  "@typespec/library-linter": "^0.87.0",
65
- "@typespec/tspd": "^0.77.1",
66
65
  "@typespec/rest": "^0.87.0",
66
+ "@typespec/tspd": "^0.77.1",
67
67
  "@typespec/versioning": "^0.87.0"
68
68
  },
69
69
  "scripts": {