Skip to content

Commit 95ecab9

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 95ecab9

File tree

11 files changed

+272
-15
lines changed

11 files changed

+272
-15
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 & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

matchers/ocaml.json

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

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 & 2 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 {
@@ -36,7 +37,6 @@ import { resolveCompiler } from "./version";
3637
export async function installer() {
3738
const platform = getPlatform();
3839
const numberOfProcessors = os.cpus().length;
39-
const isDebug = core.isDebug();
4040
core.exportVariable("OPAMCLI", "2.0");
4141
core.exportVariable("OPAMCOLOR", "always");
4242
core.exportVariable("OPAMERRLOGLEN", 0);
@@ -45,7 +45,6 @@ export async function installer() {
4545
// [todo] remove this line once we unlock opam 2.2
4646
// https://github.com/ocaml/opam/issues/3447
4747
core.exportVariable("OPAMSOLVERTIMEOUT", 1000);
48-
core.exportVariable("OPAMVERBOSE", isDebug);
4948
core.exportVariable("OPAMYES", 1);
5049
if (platform === Platform.Win32) {
5150
const opamRoot = path.join("D:", ".opam");
@@ -112,6 +111,14 @@ export async function installer() {
112111
}
113112
}
114113
}
114+
const ocamlMatcherPath = path.join(
115+
// eslint-disable-next-line unicorn/prefer-module
116+
__dirname,
117+
"..",
118+
"matchers",
119+
"ocaml.json",
120+
);
121+
issueCommand("add-matcher", {}, ocamlMatcherPath);
115122
await exec("opam", ["--version"]);
116123
if (OPAM_DEPEXT) {
117124
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)