From 3e8ab9c971f9f472a58883410bba32e6828e0731 Mon Sep 17 00:00:00 2001 From: Alex Miller Date: Mon, 11 Dec 2023 15:33:18 +1300 Subject: [PATCH] feat: add duplicate support to check and annotation pushing --- dist/index.mjs | 32 +- src/tasks/__snapshots__/check.spec.ts.snap | 345 ++++++++++++--------- src/tasks/check.spec.ts | 110 ++++++- src/tasks/check.ts | 39 ++- 4 files changed, 358 insertions(+), 168 deletions(-) diff --git a/dist/index.mjs b/dist/index.mjs index 2427104..305df9d 100644 --- a/dist/index.mjs +++ b/dist/index.mjs @@ -22179,6 +22179,7 @@ var CHECK_ANNOTATIONS_UPDATE_LIMIT = 50; var AnnotationsCount = class { exports = 0; types = 0; + duplicates = 0; enumMembers = 0; classMembers = 0; increaseCount(type) { @@ -22189,6 +22190,9 @@ var AnnotationsCount = class { case "type": this.types++; break; + case "duplicate": + this.duplicates++; + break; case "class": this.classMembers++; break; @@ -22216,7 +22220,6 @@ async function updateCheckAnnotations(checkId, itemMeta, ignoreResults) { continue; } count.increaseCount(meta.type); - const typeMessage = meta.type === "class" || meta.type === "enum" ? `${meta.type} member` : meta.type; const annotation = { path: meta.path, start_line: meta.start_line, @@ -22224,8 +22227,33 @@ async function updateCheckAnnotations(checkId, itemMeta, ignoreResults) { start_column: meta.start_column, end_column: meta.start_column + meta.identifier.length, annotation_level: ignoreResults ? "warning" : "failure", - message: `${meta.identifier} is an unused ` + typeMessage + message: "" }; + switch (meta.type) { + case "type": + case "export": + case "class": + case "enum": + { + const typeMessage = meta.type === "class" || meta.type === "enum" ? `${meta.type} member` : meta.type; + annotation.message = `'${meta.identifier}' is an unused ${typeMessage}`; + } + break; + case "duplicate": + const duplicatesStr = (() => { + const names = meta.duplicateIdentifiers.map((name) => `'${name}'`); + if (names.length <= 1) { + return names.join(""); + } + if (names.length === 2) { + return `${names[0]} and ${names[1]}`; + } + const last = names.pop(); + return `${names.join(", ")} and ${last}`; + })(); + annotation.message = `'${meta.identifier}' is a duplicate` + (duplicatesStr.length === 0 ? "" : ` of ${duplicatesStr}`); + break; + } annotations.push(annotation); } core3.debug(`[updateCheckAnnotations]: Updating check ${checkId}`); diff --git a/src/tasks/__snapshots__/check.spec.ts.snap b/src/tasks/__snapshots__/check.spec.ts.snap index abefc60..b30f443 100644 --- a/src/tasks/__snapshots__/check.spec.ts.snap +++ b/src/tasks/__snapshots__/check.spec.ts.snap @@ -29,7 +29,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 4, "end_line": 0, - "message": "Var0 is an unused export", + "message": "'Var0' is an unused export", "path": "some/path", "start_column": 0, "start_line": 0, @@ -38,7 +38,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 4, "end_line": 0, - "message": "Var1 is an unused type", + "message": "'Var1' is an unused type", "path": "some/path", "start_column": 0, "start_line": 0, @@ -47,7 +47,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 4, "end_line": 0, - "message": "Var2 is an unused class member", + "message": "'Var2' is a duplicate of 'Var2'", "path": "some/path", "start_column": 0, "start_line": 0, @@ -56,7 +56,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 4, "end_line": 0, - "message": "Var3 is an unused enum member", + "message": "'Var3' is an unused class member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -65,7 +65,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 4, "end_line": 0, - "message": "Var4 is an unused export", + "message": "'Var4' is an unused enum member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -74,7 +74,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 4, "end_line": 0, - "message": "Var5 is an unused type", + "message": "'Var5' is an unused export", "path": "some/path", "start_column": 0, "start_line": 0, @@ -83,7 +83,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 4, "end_line": 0, - "message": "Var6 is an unused class member", + "message": "'Var6' is an unused type", "path": "some/path", "start_column": 0, "start_line": 0, @@ -92,7 +92,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 4, "end_line": 0, - "message": "Var7 is an unused enum member", + "message": "'Var7' is a duplicate of 'Var2'", "path": "some/path", "start_column": 0, "start_line": 0, @@ -101,7 +101,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 4, "end_line": 0, - "message": "Var8 is an unused export", + "message": "'Var8' is an unused class member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -110,7 +110,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 4, "end_line": 0, - "message": "Var9 is an unused type", + "message": "'Var9' is an unused enum member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -119,7 +119,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var10 is an unused class member", + "message": "'Var10' is an unused export", "path": "some/path", "start_column": 0, "start_line": 0, @@ -128,7 +128,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var11 is an unused enum member", + "message": "'Var11' is an unused type", "path": "some/path", "start_column": 0, "start_line": 0, @@ -137,7 +137,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var12 is an unused export", + "message": "'Var12' is a duplicate of 'Var2'", "path": "some/path", "start_column": 0, "start_line": 0, @@ -146,7 +146,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var13 is an unused type", + "message": "'Var13' is an unused class member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -155,7 +155,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var14 is an unused class member", + "message": "'Var14' is an unused enum member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -164,7 +164,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var15 is an unused enum member", + "message": "'Var15' is an unused export", "path": "some/path", "start_column": 0, "start_line": 0, @@ -173,7 +173,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var16 is an unused export", + "message": "'Var16' is an unused type", "path": "some/path", "start_column": 0, "start_line": 0, @@ -182,7 +182,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var17 is an unused type", + "message": "'Var17' is a duplicate of 'Var2'", "path": "some/path", "start_column": 0, "start_line": 0, @@ -191,7 +191,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var18 is an unused class member", + "message": "'Var18' is an unused class member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -200,7 +200,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var19 is an unused enum member", + "message": "'Var19' is an unused enum member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -209,7 +209,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var20 is an unused export", + "message": "'Var20' is an unused export", "path": "some/path", "start_column": 0, "start_line": 0, @@ -218,7 +218,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var21 is an unused type", + "message": "'Var21' is an unused type", "path": "some/path", "start_column": 0, "start_line": 0, @@ -227,7 +227,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var22 is an unused class member", + "message": "'Var22' is a duplicate of 'Var2'", "path": "some/path", "start_column": 0, "start_line": 0, @@ -236,7 +236,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var23 is an unused enum member", + "message": "'Var23' is an unused class member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -245,7 +245,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var24 is an unused export", + "message": "'Var24' is an unused enum member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -254,7 +254,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var25 is an unused type", + "message": "'Var25' is an unused export", "path": "some/path", "start_column": 0, "start_line": 0, @@ -263,7 +263,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var26 is an unused class member", + "message": "'Var26' is an unused type", "path": "some/path", "start_column": 0, "start_line": 0, @@ -272,7 +272,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var27 is an unused enum member", + "message": "'Var27' is a duplicate of 'Var2'", "path": "some/path", "start_column": 0, "start_line": 0, @@ -281,7 +281,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var28 is an unused export", + "message": "'Var28' is an unused class member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -290,7 +290,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var29 is an unused type", + "message": "'Var29' is an unused enum member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -299,7 +299,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var30 is an unused class member", + "message": "'Var30' is an unused export", "path": "some/path", "start_column": 0, "start_line": 0, @@ -308,7 +308,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var31 is an unused enum member", + "message": "'Var31' is an unused type", "path": "some/path", "start_column": 0, "start_line": 0, @@ -317,7 +317,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var32 is an unused export", + "message": "'Var32' is a duplicate of 'Var2'", "path": "some/path", "start_column": 0, "start_line": 0, @@ -326,7 +326,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var33 is an unused type", + "message": "'Var33' is an unused class member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -335,7 +335,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var34 is an unused class member", + "message": "'Var34' is an unused enum member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -344,7 +344,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var35 is an unused enum member", + "message": "'Var35' is an unused export", "path": "some/path", "start_column": 0, "start_line": 0, @@ -353,7 +353,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var36 is an unused export", + "message": "'Var36' is an unused type", "path": "some/path", "start_column": 0, "start_line": 0, @@ -362,7 +362,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var37 is an unused type", + "message": "'Var37' is a duplicate of 'Var2'", "path": "some/path", "start_column": 0, "start_line": 0, @@ -371,7 +371,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var38 is an unused class member", + "message": "'Var38' is an unused class member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -380,7 +380,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var39 is an unused enum member", + "message": "'Var39' is an unused enum member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -389,7 +389,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var40 is an unused export", + "message": "'Var40' is an unused export", "path": "some/path", "start_column": 0, "start_line": 0, @@ -398,7 +398,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var41 is an unused type", + "message": "'Var41' is an unused type", "path": "some/path", "start_column": 0, "start_line": 0, @@ -407,7 +407,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var42 is an unused class member", + "message": "'Var42' is a duplicate of 'Var2'", "path": "some/path", "start_column": 0, "start_line": 0, @@ -416,7 +416,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var43 is an unused enum member", + "message": "'Var43' is an unused class member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -425,7 +425,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var44 is an unused export", + "message": "'Var44' is an unused enum member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -434,7 +434,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var45 is an unused type", + "message": "'Var45' is an unused export", "path": "some/path", "start_column": 0, "start_line": 0, @@ -443,7 +443,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var46 is an unused class member", + "message": "'Var46' is an unused type", "path": "some/path", "start_column": 0, "start_line": 0, @@ -452,7 +452,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var47 is an unused enum member", + "message": "'Var47' is a duplicate of 'Var2'", "path": "some/path", "start_column": 0, "start_line": 0, @@ -461,7 +461,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var48 is an unused export", + "message": "'Var48' is an unused class member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -470,7 +470,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var49 is an unused type", + "message": "'Var49' is an unused enum member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -489,7 +489,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var50 is an unused class member", + "message": "'Var50' is an unused export", "path": "some/path", "start_column": 0, "start_line": 0, @@ -498,7 +498,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var51 is an unused enum member", + "message": "'Var51' is an unused type", "path": "some/path", "start_column": 0, "start_line": 0, @@ -507,7 +507,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var52 is an unused export", + "message": "'Var52' is a duplicate of 'Var2'", "path": "some/path", "start_column": 0, "start_line": 0, @@ -516,7 +516,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var53 is an unused type", + "message": "'Var53' is an unused class member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -525,7 +525,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var54 is an unused class member", + "message": "'Var54' is an unused enum member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -534,7 +534,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var55 is an unused enum member", + "message": "'Var55' is an unused export", "path": "some/path", "start_column": 0, "start_line": 0, @@ -543,7 +543,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var56 is an unused export", + "message": "'Var56' is an unused type", "path": "some/path", "start_column": 0, "start_line": 0, @@ -552,7 +552,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var57 is an unused type", + "message": "'Var57' is a duplicate of 'Var2'", "path": "some/path", "start_column": 0, "start_line": 0, @@ -561,7 +561,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var58 is an unused class member", + "message": "'Var58' is an unused class member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -570,7 +570,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var59 is an unused enum member", + "message": "'Var59' is an unused enum member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -579,7 +579,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var60 is an unused export", + "message": "'Var60' is an unused export", "path": "some/path", "start_column": 0, "start_line": 0, @@ -588,7 +588,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var61 is an unused type", + "message": "'Var61' is an unused type", "path": "some/path", "start_column": 0, "start_line": 0, @@ -597,7 +597,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var62 is an unused class member", + "message": "'Var62' is a duplicate of 'Var2'", "path": "some/path", "start_column": 0, "start_line": 0, @@ -606,7 +606,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var63 is an unused enum member", + "message": "'Var63' is an unused class member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -615,7 +615,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var64 is an unused export", + "message": "'Var64' is an unused enum member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -624,7 +624,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var65 is an unused type", + "message": "'Var65' is an unused export", "path": "some/path", "start_column": 0, "start_line": 0, @@ -633,7 +633,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var66 is an unused class member", + "message": "'Var66' is an unused type", "path": "some/path", "start_column": 0, "start_line": 0, @@ -642,7 +642,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var67 is an unused enum member", + "message": "'Var67' is a duplicate of 'Var2'", "path": "some/path", "start_column": 0, "start_line": 0, @@ -651,7 +651,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var68 is an unused export", + "message": "'Var68' is an unused class member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -660,7 +660,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var69 is an unused type", + "message": "'Var69' is an unused enum member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -669,7 +669,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var70 is an unused class member", + "message": "'Var70' is an unused export", "path": "some/path", "start_column": 0, "start_line": 0, @@ -678,7 +678,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var71 is an unused enum member", + "message": "'Var71' is an unused type", "path": "some/path", "start_column": 0, "start_line": 0, @@ -687,7 +687,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var72 is an unused export", + "message": "'Var72' is a duplicate of 'Var2'", "path": "some/path", "start_column": 0, "start_line": 0, @@ -696,7 +696,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var73 is an unused type", + "message": "'Var73' is an unused class member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -705,7 +705,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var74 is an unused class member", + "message": "'Var74' is an unused enum member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -714,7 +714,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var75 is an unused enum member", + "message": "'Var75' is an unused export", "path": "some/path", "start_column": 0, "start_line": 0, @@ -723,7 +723,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var76 is an unused export", + "message": "'Var76' is an unused type", "path": "some/path", "start_column": 0, "start_line": 0, @@ -732,7 +732,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var77 is an unused type", + "message": "'Var77' is a duplicate of 'Var2'", "path": "some/path", "start_column": 0, "start_line": 0, @@ -741,7 +741,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var78 is an unused class member", + "message": "'Var78' is an unused class member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -750,7 +750,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var79 is an unused enum member", + "message": "'Var79' is an unused enum member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -759,7 +759,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var80 is an unused export", + "message": "'Var80' is an unused export", "path": "some/path", "start_column": 0, "start_line": 0, @@ -768,7 +768,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var81 is an unused type", + "message": "'Var81' is an unused type", "path": "some/path", "start_column": 0, "start_line": 0, @@ -777,7 +777,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var82 is an unused class member", + "message": "'Var82' is a duplicate of 'Var2'", "path": "some/path", "start_column": 0, "start_line": 0, @@ -786,7 +786,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var83 is an unused enum member", + "message": "'Var83' is an unused class member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -795,7 +795,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var84 is an unused export", + "message": "'Var84' is an unused enum member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -804,7 +804,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var85 is an unused type", + "message": "'Var85' is an unused export", "path": "some/path", "start_column": 0, "start_line": 0, @@ -813,7 +813,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var86 is an unused class member", + "message": "'Var86' is an unused type", "path": "some/path", "start_column": 0, "start_line": 0, @@ -822,7 +822,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var87 is an unused enum member", + "message": "'Var87' is a duplicate of 'Var2'", "path": "some/path", "start_column": 0, "start_line": 0, @@ -831,7 +831,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var88 is an unused export", + "message": "'Var88' is an unused class member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -840,7 +840,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var89 is an unused type", + "message": "'Var89' is an unused enum member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -849,7 +849,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var90 is an unused class member", + "message": "'Var90' is an unused export", "path": "some/path", "start_column": 0, "start_line": 0, @@ -858,7 +858,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var91 is an unused enum member", + "message": "'Var91' is an unused type", "path": "some/path", "start_column": 0, "start_line": 0, @@ -867,7 +867,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var92 is an unused export", + "message": "'Var92' is a duplicate of 'Var2'", "path": "some/path", "start_column": 0, "start_line": 0, @@ -876,7 +876,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var93 is an unused type", + "message": "'Var93' is an unused class member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -885,7 +885,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var94 is an unused class member", + "message": "'Var94' is an unused enum member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -894,7 +894,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var95 is an unused enum member", + "message": "'Var95' is an unused export", "path": "some/path", "start_column": 0, "start_line": 0, @@ -903,7 +903,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var96 is an unused export", + "message": "'Var96' is an unused type", "path": "some/path", "start_column": 0, "start_line": 0, @@ -912,7 +912,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var97 is an unused type", + "message": "'Var97' is a duplicate of 'Var2'", "path": "some/path", "start_column": 0, "start_line": 0, @@ -921,7 +921,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var98 is an unused class member", + "message": "'Var98' is an unused class member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -930,7 +930,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 5, "end_line": 0, - "message": "Var99 is an unused enum member", + "message": "'Var99' is an unused enum member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -949,7 +949,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var100 is an unused export", + "message": "'Var100' is an unused export", "path": "some/path", "start_column": 0, "start_line": 0, @@ -958,7 +958,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var101 is an unused type", + "message": "'Var101' is an unused type", "path": "some/path", "start_column": 0, "start_line": 0, @@ -967,7 +967,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var102 is an unused class member", + "message": "'Var102' is a duplicate of 'Var2'", "path": "some/path", "start_column": 0, "start_line": 0, @@ -976,7 +976,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var103 is an unused enum member", + "message": "'Var103' is an unused class member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -985,7 +985,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var104 is an unused export", + "message": "'Var104' is an unused enum member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -994,7 +994,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var105 is an unused type", + "message": "'Var105' is an unused export", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1003,7 +1003,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var106 is an unused class member", + "message": "'Var106' is an unused type", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1012,7 +1012,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var107 is an unused enum member", + "message": "'Var107' is a duplicate of 'Var2'", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1021,7 +1021,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var108 is an unused export", + "message": "'Var108' is an unused class member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1030,7 +1030,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var109 is an unused type", + "message": "'Var109' is an unused enum member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1039,7 +1039,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var110 is an unused class member", + "message": "'Var110' is an unused export", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1048,7 +1048,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var111 is an unused enum member", + "message": "'Var111' is an unused type", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1057,7 +1057,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var112 is an unused export", + "message": "'Var112' is a duplicate of 'Var2'", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1066,7 +1066,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var113 is an unused type", + "message": "'Var113' is an unused class member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1075,7 +1075,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var114 is an unused class member", + "message": "'Var114' is an unused enum member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1084,7 +1084,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var115 is an unused enum member", + "message": "'Var115' is an unused export", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1093,7 +1093,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var116 is an unused export", + "message": "'Var116' is an unused type", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1102,7 +1102,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var117 is an unused type", + "message": "'Var117' is a duplicate of 'Var2'", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1111,7 +1111,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var118 is an unused class member", + "message": "'Var118' is an unused class member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1120,7 +1120,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var119 is an unused enum member", + "message": "'Var119' is an unused enum member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1129,7 +1129,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var120 is an unused export", + "message": "'Var120' is an unused export", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1138,7 +1138,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var121 is an unused type", + "message": "'Var121' is an unused type", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1147,7 +1147,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var122 is an unused class member", + "message": "'Var122' is a duplicate of 'Var2'", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1156,7 +1156,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var123 is an unused enum member", + "message": "'Var123' is an unused class member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1165,7 +1165,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var124 is an unused export", + "message": "'Var124' is an unused enum member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1174,7 +1174,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var125 is an unused type", + "message": "'Var125' is an unused export", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1183,7 +1183,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var126 is an unused class member", + "message": "'Var126' is an unused type", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1192,7 +1192,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var127 is an unused enum member", + "message": "'Var127' is a duplicate of 'Var2'", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1201,7 +1201,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var128 is an unused export", + "message": "'Var128' is an unused class member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1210,7 +1210,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var129 is an unused type", + "message": "'Var129' is an unused enum member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1219,7 +1219,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var130 is an unused class member", + "message": "'Var130' is an unused export", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1228,7 +1228,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var131 is an unused enum member", + "message": "'Var131' is an unused type", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1237,7 +1237,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var132 is an unused export", + "message": "'Var132' is a duplicate of 'Var2'", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1246,7 +1246,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var133 is an unused type", + "message": "'Var133' is an unused class member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1255,7 +1255,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var134 is an unused class member", + "message": "'Var134' is an unused enum member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1264,7 +1264,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var135 is an unused enum member", + "message": "'Var135' is an unused export", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1273,7 +1273,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var136 is an unused export", + "message": "'Var136' is an unused type", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1282,7 +1282,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var137 is an unused type", + "message": "'Var137' is a duplicate of 'Var2'", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1291,7 +1291,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var138 is an unused class member", + "message": "'Var138' is an unused class member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1300,7 +1300,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var139 is an unused enum member", + "message": "'Var139' is an unused enum member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1309,7 +1309,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var140 is an unused export", + "message": "'Var140' is an unused export", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1318,7 +1318,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var141 is an unused type", + "message": "'Var141' is an unused type", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1327,7 +1327,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var142 is an unused class member", + "message": "'Var142' is a duplicate of 'Var2'", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1336,7 +1336,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var143 is an unused enum member", + "message": "'Var143' is an unused class member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1345,7 +1345,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var144 is an unused export", + "message": "'Var144' is an unused enum member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1354,7 +1354,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var145 is an unused type", + "message": "'Var145' is an unused export", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1363,7 +1363,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var146 is an unused class member", + "message": "'Var146' is an unused type", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1372,7 +1372,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var147 is an unused enum member", + "message": "'Var147' is a duplicate of 'Var2'", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1381,7 +1381,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var148 is an unused export", + "message": "'Var148' is an unused class member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1390,7 +1390,7 @@ exports[`check > updateCheckAnnotations > should only make three requests with 1 "annotation_level": "failure", "end_column": 6, "end_line": 0, - "message": "Var149 is an unused type", + "message": "'Var149' is an unused enum member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1413,7 +1413,7 @@ exports[`check > updateCheckAnnotations > should skip undefined or null ItemMeta "annotation_level": "failure", "end_column": 3, "end_line": 0, - "message": "Var is an unused class member", + "message": "'Var' is an unused class member", "path": "some/path", "start_column": 0, "start_line": 0, @@ -1425,13 +1425,54 @@ exports[`check > updateCheckAnnotations > should skip undefined or null ItemMeta ] `; +exports[`check > updateCheckAnnotations > should transform a duplicate ItemMeta to a valid annotation 1`] = ` +[ + { + "annotation_level": "failure", + "end_column": 3, + "end_line": 0, + "message": "'Var' is a duplicate", + "path": "some/path", + "start_column": 0, + "start_line": 0, + }, + { + "annotation_level": "failure", + "end_column": 4, + "end_line": 0, + "message": "'Var2' is a duplicate of 'Var3'", + "path": "some/path", + "start_column": 0, + "start_line": 0, + }, + { + "annotation_level": "failure", + "end_column": 4, + "end_line": 0, + "message": "'Var4' is a duplicate of 'Var5' and 'Var6'", + "path": "some/path", + "start_column": 0, + "start_line": 0, + }, + { + "annotation_level": "failure", + "end_column": 4, + "end_line": 0, + "message": "'Var7' is a duplicate of 'Var8', 'Var9' and 'Var10'", + "path": "some/path", + "start_column": 0, + "start_line": 0, + }, +] +`; + exports[`check > updateCheckAnnotations > should transform a minimal ItemMeta to a valid annotation 1`] = ` [ { "annotation_level": "failure", "end_column": 3, "end_line": 0, - "message": "Var is an unused class member", + "message": "'Var' is an unused class member", "path": "some/path", "start_column": 0, "start_line": 0, diff --git a/src/tasks/check.spec.ts b/src/tasks/check.spec.ts index a2fe677..34970ac 100644 --- a/src/tasks/check.spec.ts +++ b/src/tasks/check.spec.ts @@ -50,6 +50,49 @@ describe("check", () => { expect(updateCheckSpy.mock.lastCall?.[2]?.annotations).toMatchSnapshot(); }); + it("should transform a duplicate ItemMeta to a valid annotation", async () => { + const updateCheckSpy = vi.spyOn(api, "updateCheck"); + const items: ItemMeta[] = [ + { + path: "some/path", + identifier: "Var", + start_line: 0, + start_column: 0, + type: "duplicate", + duplicateIdentifiers: [], + }, + { + path: "some/path", + identifier: "Var2", + start_line: 0, + start_column: 0, + type: "duplicate", + duplicateIdentifiers: ["Var3"], + }, + { + path: "some/path", + identifier: "Var4", + start_line: 0, + start_column: 0, + type: "duplicate", + duplicateIdentifiers: ["Var5", "Var6"], + }, + { + path: "some/path", + identifier: "Var7", + start_line: 0, + start_column: 0, + type: "duplicate", + duplicateIdentifiers: ["Var8", "Var9", "Var10"], + }, + ]; + + await updateCheckAnnotations(0, items, false); + + expect(updateCheckSpy).toHaveBeenCalledOnce(); + expect(updateCheckSpy.mock.lastCall?.[2]?.annotations).toMatchSnapshot(); + }); + it("should output a warning annotation if ignoreResults is enabled", async () => { const updateCheckSpy = vi.spyOn(api, "updateCheck"); const items: ItemMeta[] = [ @@ -135,6 +178,14 @@ describe("check", () => { start_column: 0, type: "type", }, + { + path: "some/path", + identifier: "Var", + start_line: 0, + start_column: 0, + type: "duplicate", + duplicateIdentifiers: ["Var2"], + }, { path: "some/path", identifier: "Var", @@ -155,6 +206,7 @@ describe("check", () => { expect(counts.exports).toStrictEqual(1); expect(counts.types).toStrictEqual(1); + expect(counts.duplicates).toStrictEqual(1); expect(counts.classMembers).toStrictEqual(1); expect(counts.enumMembers).toStrictEqual(1); @@ -165,9 +217,18 @@ describe("check", () => { start_column: 0, type: "class", }); + items.push({ + path: "some/path", + identifier: "Var", + start_line: 0, + start_column: 0, + type: "duplicate", + duplicateIdentifiers: ["Var2", "Var3"], + }); counts = await updateCheckAnnotations(0, items, false); + expect(counts.duplicates).toStrictEqual(2); expect(counts.classMembers).toStrictEqual(2); expect(counts.enumMembers).toStrictEqual(1); @@ -186,6 +247,14 @@ describe("check", () => { start_column: 0, type: "type", }, + { + path: "some/path", + identifier: "Var", + start_line: 0, + start_column: 0, + type: "duplicate", + duplicateIdentifiers: ["Var2"], + }, { path: "some/path", identifier: "Var", @@ -206,6 +275,7 @@ describe("check", () => { expect(counts.exports).toStrictEqual(2); expect(counts.types).toStrictEqual(2); + expect(counts.duplicates).toStrictEqual(3); expect(counts.classMembers).toStrictEqual(3); expect(counts.enumMembers).toStrictEqual(2); }); @@ -227,27 +297,47 @@ describe("check", () => { it("should only make three requests with 150 annotations", async () => { const updateCheckSpy = vi.spyOn(api, "updateCheck"); - const iToType = (i: number): Exclude => { - switch (i % 4) { + const iToType = (i: number): ItemMeta["type"] => { + switch (i % 5) { case 0: return "export"; case 1: return "type"; case 2: - return "class"; + return "duplicate"; case 3: + return "class"; + case 4: return "enum"; default: throw new Error(); } }; - const items: ItemMeta[] = [...Array(150).keys()].map((i) => ({ - path: "some/path", - identifier: `Var${i}`, - start_line: 0, - start_column: 0, - type: iToType(i), - })); + const items: ItemMeta[] = [...Array(150).keys()].map((i) => { + const type = iToType(i); + const meta: Omit = { + path: "some/path", + identifier: `Var${i}`, + start_line: 0, + start_column: 0, + }; + switch (type) { + case "type": + case "export": + case "class": + case "enum": + return { + ...meta, + type: type, + }; + case "duplicate": + return { + ...meta, + type: type, + duplicateIdentifiers: ["Var2"], + }; + } + }); await updateCheckAnnotations(0, items, false); diff --git a/src/tasks/check.ts b/src/tasks/check.ts index 78ac95e..3e2b176 100644 --- a/src/tasks/check.ts +++ b/src/tasks/check.ts @@ -20,6 +20,7 @@ export type Annotation = NonNullable["annotati export class AnnotationsCount { public exports: number = 0; public types: number = 0; + public duplicates: number = 0; public enumMembers: number = 0; public classMembers: number = 0; @@ -31,6 +32,9 @@ export class AnnotationsCount { case "type": this.types++; break; + case "duplicate": + this.duplicates++; + break; case "class": this.classMembers++; break; @@ -74,9 +78,6 @@ export async function updateCheckAnnotations( count.increaseCount(meta.type); - const typeMessage = - meta.type === "class" || meta.type === "enum" ? `${meta.type} member` : meta.type; - const annotation: Annotation = { path: meta.path, start_line: meta.start_line, @@ -84,8 +85,38 @@ export async function updateCheckAnnotations( start_column: meta.start_column, end_column: meta.start_column + meta.identifier.length, annotation_level: ignoreResults ? "warning" : "failure", - message: `${meta.identifier} is an unused ` + typeMessage, + message: "", }; + switch (meta.type) { + case "type": + case "export": + case "class": + case "enum": + { + const typeMessage = + meta.type === "class" || meta.type === "enum" ? `${meta.type} member` : meta.type; + annotation.message = `'${meta.identifier}' is an unused ${typeMessage}`; + } + break; + case "duplicate": + // eslint-disable-next-line no-case-declarations + const duplicatesStr = (() => { + const names = meta.duplicateIdentifiers.map((name) => `'${name}'`); + if (names.length <= 1) { + return names.join(""); // coerce to string if empty collection + } + if (names.length === 2) { + return `${names[0]} and ${names[1]}`; + } + const last = names.pop(); + return `${names.join(", ")} and ${last}`; + })(); + annotation.message = + `'${meta.identifier}' is a duplicate` + + (duplicatesStr.length === 0 ? "" : ` of ${duplicatesStr}`); + break; + } + annotations.push(annotation); }