Skip to content

Commit eb4dfe9

Browse files
smorimotonzws
andcommitted
Add the OCaml problem matcher
Signed-off-by: Sora Morimoto <[email protected]> Co-authored-by: Yuzuki Aida <[email protected]>
1 parent 53b4999 commit eb4dfe9

File tree

11 files changed

+271
-11
lines changed

11 files changed

+271
-11
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ and this project adheres to
88

99
## [unreleased]
1010

11+
### Added
12+
13+
- Add the OCaml problem matcher.
14+
1115
## [2.0.20]
1216

1317
### Changed

dist/index.js

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

matchers/ocaml.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "ocaml",
5+
"pattern": [
6+
{
7+
"regexp": "^File\\s\"(.+)\",\\sline\\s(\\d+),\\scharacters\\s(\\d+)-(\\d+):$",
8+
"message": -1,
9+
"file": 1,
10+
"line": 2,
11+
"column": 3
12+
}
13+
]
14+
}
15+
]
16+
}

monorepo.code-workspace

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
{ "name": "lint-doc", "path": "lint-doc" },
55
{ "name": "lint-fmt", "path": "lint-fmt" },
66
{ "name": "lint-opam", "path": "lint-opam" },
7+
{ "name": "matchers", "path": "matchers" },
8+
{ "name": "eslint-config-ocaml", "path": "packages/eslint-config-ocaml" },
79
{ "name": "packages/lint-doc", "path": "packages/lint-doc" },
810
{ "name": "packages/lint-fmt", "path": "packages/lint-fmt" },
911
{ "name": "packages/lint-opam", "path": "packages/lint-opam" },
1012
{ "name": "packages/setup-ocaml", "path": "packages/setup-ocaml" },
11-
{ "name": "eslint-config-ocaml", "path": "packages/eslint-config-ocaml" },
1213
{ "name": "root", "path": "." }
1314
],
1415
"settings": {

packages/lint-doc/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "@ocaml/lint-doc",
33
"scripts": {
4+
"clean": "shx rm -rf ../../lint-doc/dist",
45
"build": "ncc build src/index.ts --license=LICENSE.txt --out ../../lint-doc/dist",
56
"format": "prettier . --write",
67
"format:check": "prettier . --check",
@@ -19,6 +20,7 @@
1920
"@vercel/ncc": "0.38.0",
2021
"eslint": "8.49.0",
2122
"prettier": "3.0.3",
23+
"shx": "0.3.4",
2224
"typescript": "5.2.2"
2325
},
2426
"private": true

packages/lint-fmt/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "@ocaml/lint-fmt",
33
"scripts": {
4+
"clean": "shx rm -rf ../../lint-fmt/dist",
45
"build": "ncc build src/index.ts --license=LICENSE.txt --out ../../lint-fmt/dist",
56
"format": "prettier . --write",
67
"format:check": "prettier . --check",
@@ -19,6 +20,7 @@
1920
"@vercel/ncc": "0.38.0",
2021
"eslint": "8.49.0",
2122
"prettier": "3.0.3",
23+
"shx": "0.3.4",
2224
"typescript": "5.2.2"
2325
},
2426
"private": true

packages/lint-opam/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "@ocaml/lint-opam",
33
"scripts": {
4+
"clean": "shx rm -rf ../../lint-opam/dist",
45
"build": "ncc build src/index.ts --license=LICENSE.txt --out ../../lint-opam/dist",
56
"format": "prettier . --write",
67
"format:check": "prettier . --check",
@@ -19,6 +20,7 @@
1920
"@vercel/ncc": "0.38.0",
2021
"eslint": "8.49.0",
2122
"prettier": "3.0.3",
23+
"shx": "0.3.4",
2224
"typescript": "5.2.2"
2325
},
2426
"private": true

packages/setup-ocaml/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
22
"name": "@ocaml/setup-ocaml",
33
"scripts": {
4+
"clean": "shx rm -rf ../../dist",
45
"build:main": "ncc build src/index.ts --license=LICENSE.txt --out ../../dist",
56
"build:post": "ncc build src/post.ts --license=LICENSE.txt --out ../../dist/post",
6-
"build": "yarn build:main & yarn build:post",
7+
"build": "npm-run-all -p build:main build:post",
78
"format": "prettier . --write",
89
"format:check": "prettier . --check",
910
"lint": "TIMING=1 eslint .",
@@ -31,7 +32,9 @@
3132
"@types/semver": "7.5.1",
3233
"@vercel/ncc": "0.38.0",
3334
"eslint": "8.49.0",
35+
"npm-run-all": "4.1.5",
3436
"prettier": "3.0.3",
37+
"shx": "0.3.4",
3538
"typescript": "5.2.2"
3639
},
3740
"private": true

packages/setup-ocaml/src/installer.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import * as path from "node:path";
33
import * as process from "node:process";
44

55
import * as core from "@actions/core";
6+
import { issueCommand } from "@actions/core/lib/command";
67
import { exec } from "@actions/exec";
78

89
import {
@@ -112,6 +113,14 @@ export async function installer() {
112113
}
113114
}
114115
}
116+
const ocamlMatcherPath = path.join(
117+
// eslint-disable-next-line unicorn/prefer-module
118+
__dirname,
119+
"..",
120+
"matchers",
121+
"ocaml.json",
122+
);
123+
issueCommand("add-matcher", {}, ocamlMatcherPath);
115124
await exec("opam", ["--version"]);
116125
if (OPAM_DEPEXT) {
117126
await exec("opam", ["depext", "--version"]);

turbo.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
"$schema": "https://turborepo.org/schema.json",
33
"pipeline": {
44
"build": {
5-
"dependsOn": ["^build"]
5+
"dependsOn": ["clean", "^build"]
6+
},
7+
"clean": {
8+
"cache": false
69
},
710
"format": {},
811
"format:check": {},

0 commit comments

Comments
 (0)