Skip to content

Commit 54dc2d9

Browse files
committed
Update with changes from xt0rted/problem-matcher
1 parent e58193e commit 54dc2d9

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

.editorconfig

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,13 @@ indent_size = 4
77
indent_style = space
88
trim_trailing_whitespace = true
99

10-
[*.js]
10+
[*.{js,ts}]
1111
end_of_line = lf
1212
indent_size = 2
1313

1414
[*.json]
1515
indent_size = 2
1616

17-
[*.ts]
18-
end_of_line = lf
19-
indent_size = 2
20-
2117
[*.yml]
2218
indent_size = 2
2319

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
__tests__/runner/*
22

3-
# comment out in distribution branches
43
dist/
54

65
node_modules/

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"cSpell.words": [
3+
"dependabot",
34
"promisify"
45
]
5-
}
6+
}

__tests__/problemMatcher.test.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@ import { matchResults } from "../__helpers__/utils";
22
import { problemMatcher as problemMatcherJson } from "../.github/problem-matcher.json";
33
import { ProblemMatcher, ProblemPattern } from "github-actions-problem-matcher-typings";
44

5-
const problemMatcher = problemMatcherJson[0] as ProblemMatcher;
5+
const problemMatcher: ProblemMatcher = problemMatcherJson[0];
66

77
describe("problemMatcher", () => {
8+
it("has the correct owner", () => {
9+
expect(problemMatcher.owner).toEqual("dotnet-format");
10+
});
11+
812
it("has one pattern", () => {
913
expect(problemMatcher.pattern.length).toEqual(1);
1014
});
@@ -19,24 +23,21 @@ describe("problemMatcher", () => {
1923
];
2024

2125
let pattern: ProblemPattern;
22-
let regexp: RegExp;
26+
let results: RegExpExecArray[];
2327

2428
beforeEach(() => {
2529
pattern = problemMatcher.pattern[0];
26-
regexp = new RegExp(pattern.regexp);
30+
31+
const regexp = new RegExp(pattern.regexp);
32+
33+
results = matchResults(reportOutput, regexp);
2734
});
2835

2936
it("matches violations", () => {
30-
const results = matchResults(reportOutput, regexp);
31-
3237
expect(results.length).toEqual(2);
3338
});
3439

3540
it("matches violation details", () => {
36-
const results = matchResults(reportOutput, regexp);
37-
38-
expect(results.length).toEqual(2);
39-
4041
expect(results[0][pattern.file]).toEqual("src\\ConsoleApp\\Program.cs");
4142
expect(results[0][pattern.line]).toEqual("5");
4243
expect(results[0][pattern.column]).toEqual("18");

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616
"url": "git+https://github.com/xt0rted/dotnet-format-problem-matcher.git"
1717
},
1818
"keywords": [
19-
"actions"
19+
"actions",
20+
"github",
21+
"problem-matcher",
22+
"annotations"
2023
],
2124
"author": "xt0rted",
2225
"license": "MIT",

src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { ProblemMatcher } from "github-actions-problem-matcher-typings";
99

1010
const readFileAsync = promisify(readFile);
1111

12-
export async function run() {
12+
export async function run(): Promise<void> {
1313
try {
1414
const action = getInput("action");
1515

0 commit comments

Comments
 (0)