From 57714a7c8a2e59f32539362ba31877a1957dded1 Mon Sep 17 00:00:00 2001 From: Kevin Stillhammer Date: Tue, 12 Aug 2025 21:53:24 +0200 Subject: [PATCH] bump biome to 2.1.4 (#201) --- .github/matchers/check.json | 8 +-- .github/matchers/format.json | 4 +- .vscode/extensions.json | 3 + .vscode/settings.json | 16 ++++++ biome.json | 39 ++++++++----- dist/ruff-action/index.js | Bin 1529092 -> 1529080 bytes dist/update-known-checksums/index.js | Bin 1465942 -> 1465942 bytes package-lock.json | 82 +++++++++++++++------------ package.json | 8 +-- src/download/checksum/checksum.ts | 6 +- src/download/download-version.ts | 18 +++--- src/ruff-action.ts | 19 +++---- src/update-known-checksums.ts | 6 +- src/utils/platforms.ts | 4 +- tsconfig.json | 6 +- 15 files changed, 127 insertions(+), 92 deletions(-) create mode 100644 .vscode/extensions.json create mode 100644 .vscode/settings.json diff --git a/.github/matchers/check.json b/.github/matchers/check.json index 73bc49a..82447b0 100644 --- a/.github/matchers/check.json +++ b/.github/matchers/check.json @@ -4,12 +4,12 @@ "owner": "ruff-check", "pattern": [ { - "regexp": "^Error: (.*):(\\d+):(\\d+): (\\w+) (.*)$", + "code": 4, + "column": 3, "file": 1, "line": 2, - "column": 3, - "code": 4, - "message": 5 + "message": 5, + "regexp": "^Error: (.*):(\\d+):(\\d+): (\\w+) (.*)$" } ] } diff --git a/.github/matchers/format.json b/.github/matchers/format.json index 23bddd1..344c50f 100644 --- a/.github/matchers/format.json +++ b/.github/matchers/format.json @@ -4,9 +4,9 @@ "owner": "ruff-format", "pattern": [ { - "regexp": "^(Would reformat):\\s*(.+)$", + "file": 2, "message": 1, - "file": 2 + "regexp": "^(Would reformat):\\s*(.+)$" } ] } diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..699ed73 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["biomejs.biome"] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..e66be98 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,16 @@ +{ + "editor.codeActionsOnSave": { + "source.action.useSortedAttributes.biome": "explicit", + "source.action.useSortedKeys.biome": "explicit", + "source.fixAll.biome": "explicit" + }, + "editor.defaultFormatter": "biomejs.biome", + "editor.formatOnSave": true, + "explorer.excludeGitIgnore": false, + "search.defaultViewMode": "list", + "search.exclude": { + "**/node_modules": true + }, + "typescript.enablePromptUseWorkspaceTsdk": true, + "typescript.tsdk": "node_modules/typescript/lib" +} diff --git a/biome.json b/biome.json index 748cdec..094b00b 100644 --- a/biome.json +++ b/biome.json @@ -1,20 +1,34 @@ { - "$schema": "https://biomejs.dev/schemas/1.9.2/schema.json", - "vcs": { - "enabled": true, - "clientKind": "git", - "useIgnoreFile": false + "$schema": "https://biomejs.dev/schemas/2.1.4/schema.json", + "assist": { + "actions": { + "source": { + "organizeImports": "on", + "useSortedAttributes": "on", + "useSortedKeys": "on" + } + } }, "files": { "ignoreUnknown": false, - "ignore": ["dist", "lib", "node_modules"] + "includes": [ + "**", + "!**/dist", + "!**/lib", + "!**/node_modules", + "!**/package*.json", + "!**/known-checksums.*" + ] }, "formatter": { "enabled": true, "indentStyle": "space" }, - "organizeImports": { - "enabled": true + "javascript": { + "formatter": { + "quoteStyle": "double", + "trailingCommas": "all" + } }, "linter": { "enabled": true, @@ -22,10 +36,9 @@ "recommended": true } }, - "javascript": { - "formatter": { - "quoteStyle": "double", - "trailingCommas": "all" - } + "vcs": { + "clientKind": "git", + "enabled": true, + "useIgnoreFile": false } } diff --git a/dist/ruff-action/index.js b/dist/ruff-action/index.js index b1339ccf59fa37e0825a67cf37876153fb1882b7..de9f4b018ca4ef1d020350accb0fa9c1ea6a0f79 100644 GIT binary patch delta 325 zcmZo!75iglY(ooU3sVbo3rh=Y3tJ0&3r7oQ3s(zw3r`Dg3*Q$0&n?r{Tlp=f-&!wh zGX2y=VYBH|Tlpup8@2HRu>cSY0hT`$ZFQf)r{Sg)}0 z^zI*wa?{=Wh1;i3=@Yh?9{hvRYWlf8;ppw>`h_c*G&A#xOA>Q(Qd0sFOEPp6%2JDp zGxPJT6pB)d^K;5lQ^Ftu3boTO?h_W?-aJXzkXb%CF*zeOB_uyT$0f4}NfT7}_RCX+ zmr8)0jp8D+>Fd@3Jppur#dN9lKvw;FVcqG0>xK2EuU;>#x!qxdu$ScY?I(rBrnj90 k%A7qZylML4Q^E?<>rV-*v>!et48$TpEV}*hDKW<`02V`n(*OVf delta 327 zcmeydGPY$^Y(ooU3sVbo3rh=Y3tJ0&3r7oQ3s(zw3r`Dg3*Q$0&n=U0x~Waya8a0l z`j-}d^Xboeh0UfA!~#Gp2*g6$RojH)*g&l(5S5;#0y3?b}ZQU3*Fdh()(=KPBea1pss-gX;hQ diff --git a/dist/update-known-checksums/index.js b/dist/update-known-checksums/index.js index 4f235fe42cefa92506f0c30707db3510608e51f3..aedf37ccfc9772349378ec7f6efb8fe7f4b1707a 100644 GIT binary patch delta 95 zcmcb%C-T~!$c7fi7N!>F7M2#)7Pc1l7LFFq7OocV7M>Q~7QPn#7J(MQ7NIS|n_Q>g xb`>_7-u;77Zu%KlVeaX?Zo)Owcen|cOz(6P)^FEw7Y1SxAQs)O<1VHp4gg$YAL{@B delta 94 zcmcb%C-T~!$c7fi7N!>F7M2#)7Pc1l7LFFq7OocV7M>Q~7QPn#7J(MQ7NIS|n_Q>& v|6r72HZ#|pZY#%RH=Wl_xMuoaH(~whoo>P { - let isValid: boolean | undefined = undefined; + let isValid: boolean | undefined; if (checkSum !== undefined && checkSum !== "") { isValid = await validateFileCheckSum(downloadPath, checkSum); } else { diff --git a/src/download/download-version.ts b/src/download/download-version.ts index 64f7bbe..ecd269d 100644 --- a/src/download/download-version.ts +++ b/src/download/download-version.ts @@ -1,15 +1,15 @@ +import { promises as fs } from "node:fs"; +import * as path from "node:path"; import * as core from "@actions/core"; import * as tc from "@actions/tool-cache"; -import * as path from "node:path"; -import { promises as fs } from "node:fs"; -import * as semver from "semver"; -import * as pep440 from "@renovatebot/pep440"; -import { OWNER, REPO, TOOL_CACHE_NAME } from "../utils/constants"; -import type { Architecture, Platform } from "../utils/platforms"; -import { validateChecksum } from "./checksum/checksum"; import { Octokit } from "@octokit/core"; import { paginateRest } from "@octokit/plugin-paginate-rest"; import { restEndpointMethods } from "@octokit/plugin-rest-endpoint-methods"; +import * as pep440 from "@renovatebot/pep440"; +import * as semver from "semver"; +import { OWNER, REPO, TOOL_CACHE_NAME } from "../utils/constants"; +import type { Architecture, Platform } from "../utils/platforms"; +import { validateChecksum } from "./checksum/checksum"; const PaginatingOctokit = Octokit.plugin(paginateRest, restEndpointMethods); @@ -25,7 +25,7 @@ export function tryGetFromToolCache( resolvedVersion = version; } const installedPath = tc.find(TOOL_CACHE_NAME, resolvedVersion, arch); - return { version: resolvedVersion, installedPath }; + return { installedPath, version: resolvedVersion }; } export async function downloadVersion( @@ -65,7 +65,7 @@ export async function downloadVersion( version, arch, ); - return { version: version, cachedToolDir }; + return { cachedToolDir, version: version }; } function constructDownloadUrl( diff --git a/src/ruff-action.ts b/src/ruff-action.ts index 0036840..e0100c1 100644 --- a/src/ruff-action.ts +++ b/src/ruff-action.ts @@ -1,18 +1,13 @@ +import * as fs from "node:fs"; +import * as path from "node:path"; import * as core from "@actions/core"; import * as exec from "@actions/exec"; -import * as path from "node:path"; +import * as semver from "semver"; import { downloadVersion, resolveVersion, tryGetFromToolCache, } from "./download/download-version"; - -import { - type Architecture, - getArch, - getPlatform, - type Platform, -} from "./utils/platforms"; import { args, checkSum, @@ -21,9 +16,13 @@ import { version, versionFile as versionFileInput, } from "./utils/inputs"; +import { + type Architecture, + getArch, + getPlatform, + type Platform, +} from "./utils/platforms"; import { getRuffVersionFromRequirementsFile } from "./utils/pyproject"; -import * as fs from "node:fs"; -import * as semver from "semver"; async function run(): Promise { const platform = getPlatform(); diff --git a/src/update-known-checksums.ts b/src/update-known-checksums.ts index e066e50..2b47d54 100644 --- a/src/update-known-checksums.ts +++ b/src/update-known-checksums.ts @@ -1,12 +1,10 @@ -import { Octokit } from "@octokit/core"; import * as core from "@actions/core"; +import { Octokit } from "@octokit/core"; import { paginateRest } from "@octokit/plugin-paginate-rest"; import { restEndpointMethods } from "@octokit/plugin-rest-endpoint-methods"; - -import { OWNER, REPO } from "./utils/constants"; import * as semver from "semver"; - import { updateChecksums } from "./download/checksum/update-known-checksums"; +import { OWNER, REPO } from "./utils/constants"; const PaginatingOctokit = Octokit.plugin(paginateRest, restEndpointMethods); diff --git a/src/utils/platforms.ts b/src/utils/platforms.ts index d9aeebe..81c8240 100644 --- a/src/utils/platforms.ts +++ b/src/utils/platforms.ts @@ -9,9 +9,9 @@ export type Architecture = "i686" | "x86_64" | "aarch64"; export function getArch(): Architecture | undefined { const arch = process.arch; const archMapping: { [key: string]: Architecture } = { + arm64: "aarch64", ia32: "i686", x64: "x86_64", - arm64: "aarch64", }; if (arch in archMapping) { @@ -22,8 +22,8 @@ export function getArch(): Architecture | undefined { export function getPlatform(): Platform | undefined { const platform = process.platform; const platformMapping: { [key: string]: Platform } = { - linux: "unknown-linux-gnu", darwin: "apple-darwin", + linux: "unknown-linux-gnu", win32: "pc-windows-msvc", }; diff --git a/tsconfig.json b/tsconfig.json index d8d5291..f8a5cba 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,12 +1,12 @@ { "compilerOptions": { - "target": "ES2022" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */, + "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, "module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */, + "noImplicitAny": true /* Raise error on expressions and declarations with an implied 'any' type. */, "outDir": "./lib" /* Redirect output structure to the directory. */, "rootDir": "./src" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */, "strict": true /* Enable all strict type-checking options. */, - "noImplicitAny": true /* Raise error on expressions and declarations with an implied 'any' type. */, - "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ + "target": "ES2022" /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ }, "exclude": ["node_modules", "**/*.test.ts"] }