From b851dd111f3423480db941046a8f15af82b195c7 Mon Sep 17 00:00:00 2001 From: Nathan Whitaker Date: Fri, 20 Sep 2024 10:48:52 -0700 Subject: [PATCH] Add to CI, exclude fmt/lint --- .github/workflows/ci.yml | 20 ++++++++++++++++++++ deno.json | 15 +++++++++++++++ shell-setup/src/main.ts | 4 ++-- 3 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 deno.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3948a65..dbbb3b4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,6 +14,10 @@ jobs: - name: Checkout uses: actions/checkout@v3 + - uses: denoland/setup-deno@v1 + with: + deno-version: rc + - name: lint if: matrix.os == 'macOS-latest' run: | @@ -34,3 +38,19 @@ jobs: if: matrix.os == 'windows-latest' shell: pwsh run: ./install_test.ps1 + + - name: deno lint + run: deno lint + + - name: check fmt + run: deno fmt --check + + - name: check bundled file up to date + run: | + cd shell-setup + deno task bundle + if ! git --no-pager diff --exit-code ./bundled.esm.js; then + echo 'Bundled script is out of date, update it with `cd shell-setup; deno task bundle`. + exit 1 + fi + diff --git a/deno.json b/deno.json new file mode 100644 index 0000000..c13fa68 --- /dev/null +++ b/deno.json @@ -0,0 +1,15 @@ +{ + "workspace": [ + "./shell-setup" + ], + "lint": { + "exclude": [ + "./shell-setup/bundled.esm.js" + ] + }, + "fmt": { + "exclude": [ + "./shell-setup/bundled.esm.js" + ] + } +} diff --git a/shell-setup/src/main.ts b/shell-setup/src/main.ts index 9d15235..69084a6 100644 --- a/shell-setup/src/main.ts +++ b/shell-setup/src/main.ts @@ -162,8 +162,8 @@ async function updateRcFile( command: string | UpdateRcFile, backups: Backups, ): Promise { - let prepend: string = ""; - let append: string = ""; + let prepend = ""; + let append = ""; if (typeof command === "string") { append = command; } else {