mirror of
https://github.com/astral-sh/ruff-action.git
synced 2026-05-12 20:50:14 +02:00
committed by
GitHub
parent
c9185454fa
commit
35619fdbcc
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"problemMatcher": [
|
||||
{
|
||||
"owner": "ruff-check",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^Error: (.*):(\\d+):(\\d+): (\\w+) (.*)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"code": 4,
|
||||
"message": 5
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"problemMatcher": [
|
||||
{
|
||||
"owner": "ruff-format",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^(Would reformat):\\s*(.+)$",
|
||||
"message": 1,
|
||||
"file": 2
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
+6
@@ -34614,6 +34614,7 @@ function run() {
|
||||
const setupResult = yield setupRuff(platform, arch, inputs_1.version, inputs_1.checkSum, inputs_1.githubToken);
|
||||
addRuffToPath(setupResult.ruffDir);
|
||||
setOutputFormat();
|
||||
addMatchers();
|
||||
core.setOutput("ruff-version", setupResult.version);
|
||||
core.info(`Successfully installed ruff version ${setupResult.version}`);
|
||||
yield runRuff(path.join(setupResult.ruffDir, "ruff"), inputs_1.args.split(" "), inputs_1.src.split(" "));
|
||||
@@ -34650,6 +34651,11 @@ function setOutputFormat() {
|
||||
core.exportVariable("RUFF_OUTPUT_FORMAT", "github");
|
||||
core.info("Set RUFF_OUTPUT_FORMAT to github");
|
||||
}
|
||||
function addMatchers() {
|
||||
const matchersPath = path.join(__dirname, `..${path.sep}..`, ".github", "matchers");
|
||||
core.info(`##[add-matcher]${path.join(matchersPath, "check.json")}`);
|
||||
core.info(`##[add-matcher]${path.join(matchersPath, "format.json")}`);
|
||||
}
|
||||
function runRuff(ruffExecutablePath, args, src) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const execArgs = [...args, ...src];
|
||||
|
||||
@@ -36,6 +36,7 @@ async function run(): Promise<void> {
|
||||
|
||||
addRuffToPath(setupResult.ruffDir);
|
||||
setOutputFormat();
|
||||
addMatchers();
|
||||
core.setOutput("ruff-version", setupResult.version);
|
||||
core.info(`Successfully installed ruff version ${setupResult.version}`);
|
||||
|
||||
@@ -92,6 +93,17 @@ function setOutputFormat() {
|
||||
core.info("Set RUFF_OUTPUT_FORMAT to github");
|
||||
}
|
||||
|
||||
function addMatchers(): void {
|
||||
const matchersPath = path.join(
|
||||
__dirname,
|
||||
`..${path.sep}..`,
|
||||
".github",
|
||||
"matchers",
|
||||
);
|
||||
core.info(`##[add-matcher]${path.join(matchersPath, "check.json")}`);
|
||||
core.info(`##[add-matcher]${path.join(matchersPath, "format.json")}`);
|
||||
}
|
||||
|
||||
async function runRuff(
|
||||
ruffExecutablePath: string,
|
||||
args: string[],
|
||||
|
||||
Reference in New Issue
Block a user