Skip to content

Commit

Permalink
"chore(rehearsal): compatibility for upcoming TypeScript 4.9.1"
Browse files Browse the repository at this point in the history
  • Loading branch information
rehearsal[bot] committed Oct 18, 2022
1 parent 9fd01a9 commit e1f352b
Show file tree
Hide file tree
Showing 4 changed files with 224 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ export async function run(): Promise<void> {
});

const defaultBranch = context.payload?.repository?.default_branch as string;

console.log(context.payload?.repository);

const pullInfo = await generatePullRequestTitleAndBody(baseDir);

await group('Commit changes (except package.json and *.lock files)', async () => {
Expand Down Expand Up @@ -78,7 +78,7 @@ export async function run(): Promise<void> {

const response = await pulls.list({ ...pullBase, state: 'open' });
const pullNumber = response.data?.shift()?.number;

console.log(pullBase);
console.log(response.data);

Expand Down
90 changes: 90 additions & 0 deletions test/.rehearsal/report.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"summary": {
"projectName": "@rehearsal/action",
"tsVersion": "4.9.1-beta",
"timestamp": "2022-10-18T19:04:44.781Z",
"basePath": "/home/runner/work/action/action/test",
"uniqueErrors": 1,
"totalErrors": 2,
"totalErrorsList": {
"6133": 2
},
"fixedErrors": 1,
"fixedErrorsList": {
"6133": 1
},
"files": 1,
"filesList": [
"/test.ts"
]
},
"items": [
{
"analysisTarget": "/home/runner/work/action/action/test/test.ts",
"files": {
"/home/runner/work/action/action/test/test.ts": {
"fileName": "/home/runner/work/action/action/test/test.ts",
"location": {
"line": 2,
"character": 9
},
"fixed": true,
"code": " b",
"codeFixAction": "delete",
"hintAdded": false,
"roles": [
"analysisTarget",
"modified"
]
}
},
"errorCode": 6133,
"category": "Error",
"message": "'b' is declared but its value is never read.",
"hint": "The variable 'b' is never read or used. Remove the variable or use it.",
"fixed": true,
"nodeKind": "Identifier",
"nodeText": "b",
"helpUrl": "https://stackoverflow.com/search?tab=votes&q=TS6133",
"nodeLocation": {
"start": 29,
"length": 1,
"line": 1,
"character": 8
}
},
{
"analysisTarget": "/home/runner/work/action/action/test/test.ts",
"files": {
"/home/runner/work/action/action/test/test.ts": {
"fileName": "/home/runner/work/action/action/test/test.ts",
"location": {
"line": 2,
"character": 11
},
"fixed": false,
"hint": "The variable 'b' is never read or used. Remove the variable or use it.",
"hintAdded": true,
"roles": [
"analysisTarget",
"unmodified"
]
}
},
"errorCode": 6133,
"category": "Error",
"message": "'b' is declared but its value is never read.",
"hint": "The variable 'b' is never read or used. Remove the variable or use it.",
"fixed": false,
"nodeKind": "Identifier",
"nodeText": "b",
"helpUrl": "https://stackoverflow.com/search?tab=votes&q=TS6133",
"nodeLocation": {
"start": 31,
"length": 1,
"line": 1,
"character": 10
}
}
]
}
130 changes: 130 additions & 0 deletions test/.rehearsal/report.sarif
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
{
"version": "2.1.0",
"$schema": "http://json.schemastore.org/sarif-2.1.0-rtm.4",
"runs": [
{
"tool": {
"driver": {
"name": "@rehearsal/upgrade",
"informationUri": "https://github.com/rehearsal-js/rehearsal-js",
"rules": [
{
"id": "TS6133",
"name": "TS6133",
"shortDescription": {
"text": "'b' is declared but its value is never read."
},
"helpUri": ""
}
]
}
},
"artifacts": [
{
"location": {
"uri": "/home/runner/work/action/action/test/test.ts"
},
"roles": [
"analysisTarget",
"modified"
],
"properties": {
"fixed": true,
"hintAdded": true
}
}
],
"results": [
{
"ruleId": "TS6133",
"ruleIndex": 0,
"level": "error",
"baselineState": "updated",
"kind": "review",
"message": {
"text": "The variable 'b' is never read or used. Remove the variable or use it."
},
"analysisTarget": {
"uri": "/home/runner/work/action/action/test/test.ts"
},
"locations": [
{
"physicalLocation": {
"artifactLocation": {
"uri": "/home/runner/work/action/action/test/test.ts",
"index": 0
},
"region": {
"startLine": 2,
"startColumn": 9
},
"properties": {
"code": " b",
"codeFixAction": "delete",
"roles": [
"analysisTarget",
"modified"
]
}
}
}
],
"relatedLocations": [],
"properties": {
"fixed": true,
"fixes": [
{
"fileName": "/home/runner/work/action/action/test/test.ts",
"code": " b",
"codeFixAction": "delete"
}
]
}
},
{
"ruleId": "TS6133",
"ruleIndex": 0,
"level": "error",
"baselineState": "unchanged",
"kind": "informational",
"message": {
"text": "The variable 'b' is never read or used. Remove the variable or use it."
},
"analysisTarget": {
"uri": "/home/runner/work/action/action/test/test.ts"
},
"locations": [
{
"physicalLocation": {
"artifactLocation": {
"uri": "/home/runner/work/action/action/test/test.ts",
"index": 0
},
"region": {
"startLine": 2,
"startColumn": 11
},
"properties": {
"roles": [
"analysisTarget",
"unmodified"
]
}
}
}
],
"relatedLocations": [],
"properties": {
"fixed": false,
"fixes": []
}
}
],
"automationDetails": {
"description": {
"text": "This is the run of @rehearsal/upgrade on your product against TypeScript 4.9.1-beta at 2022-10-18T19:04:44.781Z"
}
}
}
]
}
1 change: 1 addition & 0 deletions test/test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
function a(): void {
/* @ts-ignore @rehearsal TODO TS6133: The variable 'b' is never read or used. Remove the variable or use it. */
const b = 'a';
}

0 comments on commit e1f352b

Please sign in to comment.