Skip to content

Commit 864e6e3

Browse files
committed
adding fingerprint
1 parent 37df917 commit 864e6e3

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/format.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { parse, GrammarItem } from '@aivenio/tsc-output-parser';
22
import { Issue } from 'codeclimate-types';
3+
import { createHash } from "node:crypto";
34

45
export default function format (input: string): Issue[] {
56
const foo: GrammarItem[] = parse(input);
@@ -11,6 +12,7 @@ export default function format (input: string): Issue[] {
1112
check_name: inputItem.value.tsError.value.errorString,
1213
description: inputItem.value.message.value,
1314
severity: 'major',
15+
fingerprint: createHash("sha256").update(inputItem.value.path.value + ":" +inputItem.value.tsError.value.errorString).digest("hex"),
1416
location: {
1517
path: inputItem.value.path.value,
1618
positions: {

test/format.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ describe("format", () => {
1010
],
1111
"check_name": "TS7006",
1212
"description": " Parameter 'node' implicitly has an 'any' type.\n",
13+
"fingerprint": "20066f3363e75e58f37a5d94dc4b2e833e31166d7be38fa3e3e13788ff644747",
1314
"location": {
1415
"path": "node_modules/example/example.d.ts",
1516
"positions": {
@@ -32,6 +33,7 @@ describe("format", () => {
3233
],
3334
"check_name": "TS7006",
3435
"description": " Parameter 'node' implicitly has an 'any' type.\n",
36+
"fingerprint": "e76aa9fe395c5050ed3cc53bb4ee5d12c3d15afadb361a436a8db8bd1f42670e",
3537
"location": {
3638
"path": "example/example.d.ts",
3739
"positions": {

0 commit comments

Comments
 (0)