From 6ec544a43d62336bb40303c9477b894fba8554a1 Mon Sep 17 00:00:00 2001 From: r7kamura Date: Thu, 30 May 2024 09:05:27 +0900 Subject: [PATCH] Add problem matchers for `deno lint` --- deno-problem-matchers.json | 21 +++++++++++++++++++++ main.mjs | 9 +++++++++ 2 files changed, 30 insertions(+) create mode 100644 deno-problem-matchers.json diff --git a/deno-problem-matchers.json b/deno-problem-matchers.json new file mode 100644 index 00000000..65bc3f02 --- /dev/null +++ b/deno-problem-matchers.json @@ -0,0 +1,21 @@ +{ + "problemMatcher": [ + { + "owner": "deno-lint", + "pattern": [ + { + "regexp": "^(?:\\x1B\\[[0-9;]*[a-zA-Z])*(warning|warn|error)(?:\\[(\\S*)\\])?(?:\\x1B\\[[0-9;]*[a-zA-Z])*: (.*?)(?:\\x1B\\[[0-9;]*[a-zA-Z])*$", + "severity": 1, + "code": 2, + "message": 3 + }, + { + "regexp": "^ (?:\\x1B\\[[0-9;]*[a-zA-Z])*-->(?:\\x1B\\[[0-9;]*[a-zA-Z])* (?:\\x1B\\[[0-9;]*[a-zA-Z])*(\\S+?)(?:\\x1B\\[[0-9;]*[a-zA-Z])*:(\\d+):(\\d+)(?:\\x1B\\[[0-9;]*[a-zA-Z])*$", + "file": 1, + "line": 2, + "column": 3 + } + ] + } + ] +} diff --git a/main.mjs b/main.mjs index 9e59fd89..f9da2924 100644 --- a/main.mjs +++ b/main.mjs @@ -1,5 +1,6 @@ import process from "node:process"; import core from "@actions/core"; +import path from "node:path"; import { getDenoVersionFromFile, parseVersionRange, @@ -38,6 +39,14 @@ async function main() { await install(version); + if (import.meta.dirname) { + core.info( + `::add-matcher::${ + path.join(import.meta.dirname, "deno-problem-matchers.json") + }`, + ); + } + core.setOutput("deno-version", version.version); core.setOutput("release-channel", version.kind);