From 5e73acb4ec9096b63594632af922c8674928f5e2 Mon Sep 17 00:00:00 2001 From: Techatrix Date: Sat, 22 Feb 2025 20:00:39 +0100 Subject: [PATCH] ensure that CI will fail if the code is not properly formatted The CI would previously run `prettier --write . --check` but it should be doing `prettier --check .` --- .github/workflows/main.yml | 2 +- package.json | 1 + src/zigMainCodeLens.ts | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 62e2931..2dd3b1e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,7 @@ jobs: - run: npm run build - run: npm run typecheck - run: npm run lint - - run: npm run format -- --check + - run: npm run format:check - name: package extension run: | diff --git a/package.json b/package.json index 7a10065..19c9a60 100644 --- a/package.json +++ b/package.json @@ -367,6 +367,7 @@ "test": "npm run compile && node ./node_modules/vscode/bin/test", "typecheck": "tsc --noEmit", "format": "prettier --write .", + "format:check": "prettier --check .", "lint": "eslint ." }, "devDependencies": { diff --git a/src/zigMainCodeLens.ts b/src/zigMainCodeLens.ts index b8ca644..50c8f4f 100644 --- a/src/zigMainCodeLens.ts +++ b/src/zigMainCodeLens.ts @@ -56,7 +56,7 @@ function zigRun() { function escapePath(rawPath: string): string { if (/[ !"#$&'()*,;:<>?\[\\\]^`{|}]/.test(rawPath)) { - return `"${rawPath.replaceAll("\"", "\"\\\"\"")}"`; + return `"${rawPath.replaceAll('"', '"\\""')}"`; } return rawPath; }