From d633b1a83b92b294dbbf6f41e5dafd19b18dba1d 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` --- main.js | 3 +++ problem-matchers.json | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 problem-matchers.json diff --git a/main.js b/main.js index 9242d7d..6a11f3c 100644 --- a/main.js +++ b/main.js @@ -1,5 +1,6 @@ const process = require("process"); const core = require("@actions/core"); +const path = require("path"); const { parseVersionRange, resolveVersion } = require("./src/version.js"); const { install } = require("./src/install.js"); @@ -33,6 +34,8 @@ async function main() { await install(version); + core.info(`::add-matcher::${path.join(__dirname, "problem-matchers.json")}`); + core.setOutput("deno-version", version.version); core.setOutput("is-canary", version.isCanary); diff --git a/problem-matchers.json b/problem-matchers.json new file mode 100644 index 0000000..65bc3f0 --- /dev/null +++ b/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 + } + ] + } + ] +}