Compare commits

...
9 Commits
Author SHA1 Message Date
Kevin StillhammerandGitHub 31a5185046 Replace toml parsing library (#32)
"toml" does not support all TOML features
https://github.com/BinaryMuse/toml-node/issues/51

Fixes: #31
2024-12-23 19:07:34 +01:00
Kevin StillhammerandGitHub 7a82f1f7e4 Default to ruff-version from pyproject.toml (#30)
Closes: #9 

Changes the default behavior to:

- Search for a pyproject.toml in the repo root
- Search in project.dependencies and dependency-groups.dev for ruff
- If none is found use latest

Support for requirements.txt files can be added later
2024-12-23 11:07:46 +01:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
cac2f108b2 Bump @types/node from 22.10.1 to 22.10.2 (#29)
Bumps
[@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node)
from 22.10.1 to 22.10.2.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@types/node&package-manager=npm_and_yarn&previous-version=22.10.1&new-version=22.10.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-16 17:23:51 +01:00
Kevin StillhammerandGitHub 35619fdbcc Add problem matchers (#26)
Closes: #12
2024-12-08 12:17:50 +01:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
c9185454fa Bump @types/node from 22.9.3 to 22.10.1 (#20)
Bumps
[@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node)
from 22.9.3 to 22.10.1.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@types/node&package-manager=npm_and_yarn&previous-version=22.9.3&new-version=22.10.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-08 11:38:39 +01:00
Kevin StillhammerandGitHub a2d5d1ffa4 Set output format to github (#24)
This was accidentally removed in the v2 release
2024-12-08 11:36:31 +01:00
Kevin StillhammerandGitHub ec9ad4417f Add lint error in malformed python project (#25) 2024-12-08 11:31:53 +01:00
Kevin StillhammerandGitHub efef6ba8fa Move release-drafter.yml to .github (#22)
Fixes `Configuration file .github/release-drafter.yml is not found. The
configuration file must reside in your default branch.`
2024-12-06 13:17:45 +01:00
Christian ClaussandGitHub e5ab5d43a6 README.md: astral-sh/ruff-action@v1 --> v2 (#21)
README.md upgraded to match
https://github.com/astral-sh/ruff-action/releases
```diff
- - uses: astral-sh/ruff-action@v1
+ - uses: astral-sh/ruff-action@v2
```
2024-12-06 08:49:52 +01:00
19 changed files with 2530 additions and 70 deletions
+17
View File
@@ -0,0 +1,17 @@
{
"problemMatcher": [
{
"owner": "ruff-check",
"pattern": [
{
"regexp": "^Error: (.*):(\\d+):(\\d+): (\\w+) (.*)$",
"file": 1,
"line": 2,
"column": 3,
"code": 4,
"message": 5
}
]
}
]
}
+14
View File
@@ -0,0 +1,14 @@
{
"problemMatcher": [
{
"owner": "ruff-format",
"pattern": [
{
"regexp": "^(Would reformat):\\s*(.+)$",
"message": 1,
"file": 2
}
]
}
]
}
+50 -5
View File
@@ -28,17 +28,18 @@ jobs:
- name: Make sure no changes from linters are detected
run: |
git diff --exit-code
test-default-version:
test-latest-version:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, macos-14, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Use default version
- name: Use latest version
uses: ./
with:
src: __tests__/fixtures/python-project
version: latest
test-specific-version:
runs-on: ubuntu-latest
strategy:
@@ -51,6 +52,39 @@ jobs:
with:
version: ${{ matrix.ruff-version }}
src: __tests__/fixtures/python-project
test-default-version-from-pyproject:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use default version from pyproject.toml
id: ruff-action
uses: ./
with:
src: __tests__/fixtures/python-project
- name: Correct version gets installed
run: |
if [ "$RUFF_VERSION" != "0.6.2" ]; then
exit 1
fi
env:
RUFF_VERSION: ${{ steps.ruff-action.outputs.ruff-version }}
test-default-version-from-pyproject-dev-group:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use default version from pyproject.toml dev group
id: ruff-action
uses: ./
with:
src: __tests__/fixtures/pyproject-dependency-dev-project
version-file: __tests__/fixtures/pyproject-dependency-dev-project/pyproject.toml
- name: Correct version gets installed
run: |
if [ "$RUFF_VERSION" != "0.8.3" ]; then
exit 1
fi
env:
RUFF_VERSION: ${{ steps.ruff-action.outputs.ruff-version }}
test-semver-range:
runs-on: ubuntu-latest
steps:
@@ -114,8 +148,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use args
id: should-fail
- name: Format should fail
id: format-should-fail
continue-on-error: true
uses: ./
with:
@@ -123,7 +157,18 @@ jobs:
src: __tests__/fixtures/malformed-python-project
- name: Check if the action failed
run: |
if [ ${{ steps.should-fail.outcome }} == "success" ]; then
if [ ${{ steps.format-should-fail.outcome }} == "success" ]; then
exit 1
fi
- name: Check should fail
id: check-should-fail
continue-on-error: true
uses: ./
with:
src: __tests__/fixtures/malformed-python-project
- name: Check if the action failed
run: |
if [ ${{ steps.check-should-fail.outcome }} == "success" ]; then
exit 1
fi
test-multiple-src:
+32 -20
View File
@@ -19,19 +19,21 @@ fix).
- [Install the latest version (default)](#install-the-latest-version-default)
- [Install a specific version](#install-a-specific-version)
- [Install a version by supplying a semver range](#install-a-version-by-supplying-a-semver-range)
- [Install a version from a specified version file](#install-a-version-from-a-specified-version-file)
- [Validate checksum](#validate-checksum)
- [GitHub authentication token](#github-authentication-token)
- [Outputs](#outputs)
## Usage
| Input | Description | Default |
|----------------|---------------------------------------------------------------------------------------------|--------------------|
| `version` | The version of Ruff to install. See [Install specific versions](#install-specific-versions) | `latest` |
| `args` | The arguments to pass to the `ruff` command. See [Configuring Ruff] | `check` |
| `src` | The directory or single files to run `ruff` on. | [github.workspace] |
| `checksum` | The sha256 checksum of the downloaded executable. | None |
| `github-token` | The GitHub token to use for authentication. | `GITHUB_TOKEN` |
| Input | Description | Default |
|----------------|--------------------------------------------------------------------------------------------------------------------------------------------|--------------------|
| `version` | The version of Ruff to install. See [Install specific versions](#install-specific-versions) | `latest` |
| `version-file` | The file to read the version from. See [Install a version from a specified version file](#install-a-version-from-a-specified-version-file) | None |
| `args` | The arguments to pass to the `ruff` command. See [Configuring Ruff] | `check` |
| `src` | The directory or single files to run `ruff` on. | [github.workspace] |
| `checksum` | The sha256 checksum of the downloaded executable. | None |
| `github-token` | The GitHub token to use for authentication. | `GITHUB_TOKEN` |
### Basic
@@ -42,7 +44,7 @@ fix).
### Specify a different source directory
```yaml
- uses: astral-sh/ruff-action@v1
- uses: astral-sh/ruff-action@v2
with:
src: "./src"
```
@@ -50,7 +52,7 @@ fix).
### Specify multiple files
```yaml
- uses: astral-sh/ruff-action@v1
- uses: astral-sh/ruff-action@v2
with:
src: >-
path/to/file1.py
@@ -62,7 +64,7 @@ fix).
This action adds ruff to the PATH, so you can use it in subsequent steps.
```yaml
- uses: astral-sh/ruff-action@v1
- uses: astral-sh/ruff-action@v2
- run: ruff check --fix
- run: ruff format
```
@@ -70,14 +72,18 @@ This action adds ruff to the PATH, so you can use it in subsequent steps.
### Use `ruff format`
```yaml
- uses: astral-sh/ruff-action@v1
- uses: astral-sh/ruff-action@v2
with:
args: "format --check"
```
### Install specific versions
#### Install the latest version (default)
By default this action looks for a pyproject.toml file in the root of the repository to determine
the ruff version to install. If no pyproject.toml file is found, or no ruff version is defined in
either `dependencies` or `dependency-groups.dev` the latest version is installed.
#### Install the latest version
```yaml
- name: Install the latest version of ruff
@@ -86,13 +92,7 @@ This action adds ruff to the PATH, so you can use it in subsequent steps.
version: "latest"
```
> [!TIP]
>
> Using `latest` requires to download the ruff executable on every run, which incurs a cost
> (especially on self-hosted runners). As a best practice, consider pinning the version to a
> specific release.
### Install a specific version
#### Install a specific version
```yaml
- name: Install a specific version of ruff
@@ -101,7 +101,7 @@ This action adds ruff to the PATH, so you can use it in subsequent steps.
version: "0.4.4"
```
### Install a version by supplying a semver range
#### Install a version by supplying a semver range
You can specify a [semver range](https://github.com/npm/node-semver?tab=readme-ov-file#ranges)
to install the latest version that satisfies the range.
@@ -120,6 +120,18 @@ to install the latest version that satisfies the range.
version: "0.4.x"
```
#### Install a version from a specified version file
You can specify a file to read the version from.
Currently `pyproject.toml` is supported.
```yaml
- name: Install a version from a specified version file
uses: astral-sh/ruff-action@v2
with:
version-file: "my-path/to/pyproject.toml"
```
### Validate checksum
You can specify a checksum to validate the downloaded executable. Checksums up to the default version
@@ -1,2 +1,4 @@
import sys
print("Hello world!")
print('How are you?')
@@ -0,0 +1,15 @@
[project]
name = "pyproject-dependency-dev-project"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.12"
[dependency-groups]
dev = [
"ruff==0.8.3"
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
@@ -0,0 +1,2 @@
def hello() -> str:
return "Hello from python-project!"
@@ -5,7 +5,7 @@ description = "Add your description here"
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
"ruff>=0.6.2",
"ruff==0.6.2",
]
[build-system]
+5 -2
View File
@@ -11,9 +11,12 @@ inputs:
required: false
default: ${{ github.workspace }}
version:
description: "The version of Ruff to use, e.g., `0.6.0` Defaults to the latest version."
description: "The version of Ruff to use, e.g., `0.6.0` Defaults to the version in pyproject.toml or 'latest'."
required: false
default: ""
version-file:
description: "Path to a pyproject.toml or requirements.txt file to read the version from."
required: false
default: "latest"
checksum:
description: "The checksum of the ruff version to install"
required: false
Generated Vendored
+2279 -9
View File
File diff suppressed because it is too large Load Diff
+17 -10
View File
@@ -12,11 +12,12 @@
"@actions/core": "^1.11.1",
"@actions/exec": "^1.1.1",
"@actions/github": "^6.0.0",
"@actions/tool-cache": "^2.0.1"
"@actions/tool-cache": "^2.0.1",
"@iarna/toml": "^2.2.5"
},
"devDependencies": {
"@biomejs/biome": "1.9.4",
"@types/node": "^22.9.1",
"@types/node": "^22.10.2",
"@types/semver": "^7.5.8",
"@vercel/ncc": "^0.38.3",
"js-yaml": "^4.1.0",
@@ -241,6 +242,11 @@
"node": ">=14"
}
},
"node_modules/@iarna/toml": {
"version": "2.2.5",
"resolved": "https://registry.npmjs.org/@iarna/toml/-/toml-2.2.5.tgz",
"integrity": "sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg=="
},
"node_modules/@octokit/auth-token": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-4.0.0.tgz",
@@ -386,12 +392,12 @@
}
},
"node_modules/@types/node": {
"version": "22.9.3",
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.9.3.tgz",
"integrity": "sha512-F3u1fs/fce3FFk+DAxbxc78DF8x0cY09RRL8GnXLmkJ1jvx3TtPdWoTT5/NiYfI5ASqXBmfqJi9dZ3gxMx4lzw==",
"version": "22.10.2",
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.2.tgz",
"integrity": "sha512-Xxr6BBRCAOQixvonOye19wnzyDiUtTeqldOOmj3CkeblonbccA12PFwlufvRdrpjXxqnmUaeiU5EOA+7s5diUQ==",
"dev": true,
"dependencies": {
"undici-types": "~6.19.8"
"undici-types": "~6.20.0"
}
},
"node_modules/@types/semver": {
@@ -486,10 +492,11 @@
}
},
"node_modules/undici-types": {
"version": "6.19.8",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz",
"integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==",
"dev": true
"version": "6.20.0",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz",
"integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==",
"dev": true,
"license": "MIT"
},
"node_modules/universal-user-agent": {
"version": "6.0.1",
+3 -2
View File
@@ -25,11 +25,12 @@
"@actions/core": "^1.11.1",
"@actions/exec": "^1.1.1",
"@actions/github": "^6.0.0",
"@actions/tool-cache": "^2.0.1"
"@actions/tool-cache": "^2.0.1",
"@iarna/toml": "^2.2.5"
},
"devDependencies": {
"@biomejs/biome": "1.9.4",
"@types/node": "^22.9.1",
"@types/node": "^22.10.2",
"@types/semver": "^7.5.8",
"@vercel/ncc": "^0.38.3",
"js-yaml": "^4.1.0",
+4 -11
View File
@@ -29,13 +29,12 @@ export async function downloadVersion(
checkSum: string | undefined,
githubToken: string,
): Promise<{ version: string; cachedToolDir: string }> {
const resolvedVersion = await resolveVersion(version, githubToken);
const artifact = `ruff-${arch}-${platform}`;
let extension = ".tar.gz";
if (platform === "pc-windows-msvc") {
extension = ".zip";
}
const downloadUrl = `https://github.com/${OWNER}/${REPO}/releases/download/${resolvedVersion}/${artifact}${extension}`;
const downloadUrl = `https://github.com/${OWNER}/${REPO}/releases/download/${version}/${artifact}${extension}`;
core.info(`Downloading ruff from "${downloadUrl}" ...`);
const downloadPath = await tc.downloadTool(
@@ -43,13 +42,7 @@ export async function downloadVersion(
undefined,
githubToken,
);
await validateChecksum(
checkSum,
downloadPath,
arch,
platform,
resolvedVersion,
);
await validateChecksum(checkSum, downloadPath, arch, platform, version);
let ruffDir: string;
if (platform === "pc-windows-msvc") {
@@ -64,10 +57,10 @@ export async function downloadVersion(
const cachedToolDir = await tc.cacheDir(
ruffDir,
TOOL_CACHE_NAME,
resolvedVersion,
version,
arch,
);
return { version: resolvedVersion, cachedToolDir };
return { version: version, cachedToolDir };
}
export async function resolveVersion(
+54 -10
View File
@@ -13,7 +13,16 @@ import {
getPlatform,
type Platform,
} from "./utils/platforms";
import { args, checkSum, githubToken, src, version } from "./utils/inputs";
import {
args,
checkSum,
githubToken,
src,
version,
versionFile as versionFileInput,
} from "./utils/inputs";
import { getRuffVersionFromPyproject } from "./utils/pyproject";
import * as fs from "node:fs";
async function run(): Promise<void> {
const platform = getPlatform();
@@ -26,15 +35,11 @@ async function run(): Promise<void> {
if (arch === undefined) {
throw new Error(`Unsupported architecture: ${process.arch}`);
}
const setupResult = await setupRuff(
platform,
arch,
version,
checkSum,
githubToken,
);
const setupResult = await setupRuff(platform, arch, checkSum, githubToken);
addRuffToPath(setupResult.ruffDir);
setOutputFormat();
addMatchers();
core.setOutput("ruff-version", setupResult.version);
core.info(`Successfully installed ruff version ${setupResult.version}`);
@@ -53,11 +58,10 @@ async function run(): Promise<void> {
async function setupRuff(
platform: Platform,
arch: Architecture,
versionInput: string,
checkSum: string | undefined,
githubToken: string,
): Promise<{ ruffDir: string; version: string }> {
const resolvedVersion = await resolveVersion(versionInput, githubToken);
const resolvedVersion = await determineVersion();
const toolCacheResult = tryGetFromToolCache(arch, resolvedVersion);
if (toolCacheResult.installedPath) {
core.info(`Found ruffDir in tool-cache for ${toolCacheResult.version}`);
@@ -81,11 +85,51 @@ async function setupRuff(
};
}
async function determineVersion(): Promise<string> {
if (versionFileInput !== "" && version !== "") {
throw Error("It is not allowed to specify both version and version-file");
}
if (version !== "") {
return await resolveVersion(version, githubToken);
}
if (versionFileInput !== "") {
const versionFromPyproject = getRuffVersionFromPyproject(versionFileInput);
if (versionFromPyproject === undefined) {
core.warning(
"Could not parse version from supplied pyproject.toml. Using latest version.",
);
return await resolveVersion("latest", githubToken);
}
}
const pyProjectPath = path.join(src, "pyproject.toml");
if (!fs.existsSync(pyProjectPath)) {
return await resolveVersion("latest", githubToken);
}
const versionFromPyproject = getRuffVersionFromPyproject(pyProjectPath);
return await resolveVersion(versionFromPyproject || "latest", githubToken);
}
function addRuffToPath(cachedPath: string): void {
core.addPath(cachedPath);
core.info(`Added ${cachedPath} to the path`);
}
function setOutputFormat() {
core.exportVariable("RUFF_OUTPUT_FORMAT", "github");
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[],
+1
View File
@@ -5,3 +5,4 @@ export const checkSum = core.getInput("checksum");
export const githubToken = core.getInput("github-token");
export const args = core.getInput("args");
export const src = core.getInput("src");
export const versionFile = core.getInput("version-file");
+33
View File
@@ -0,0 +1,33 @@
import * as fs from "node:fs";
import * as core from "@actions/core";
import * as toml from "@iarna/toml";
export function getRuffVersionFromPyproject(
filePath: string,
): string | undefined {
const pyprojectContent = fs.readFileSync(filePath, "utf-8");
const pyproject = toml.parse(pyprojectContent) as {
project?: { dependencies?: string[] };
"dependency-groups"?: { dev?: string[] };
};
const dependencies: string[] = pyproject?.project?.dependencies || [];
const devDependencies: string[] = pyproject?.["dependency-groups"]?.dev || [];
const ruffVersionDefinition =
dependencies.find((dep: string) => dep.startsWith("ruff")) ||
devDependencies.find((dep: string) => dep.startsWith("ruff"));
if (ruffVersionDefinition) {
const ruffVersion = ruffVersionDefinition
.match(/^ruff([^A-Z0-9._-]+.*)$/)?.[1]
.trim();
if (ruffVersion?.startsWith("==")) {
return ruffVersion.slice(2);
}
core.info(`Found ruff version in pyproject.toml: ${ruffVersion}`);
return ruffVersion;
}
return undefined;
}