From 323a43a8693255a40a9099f759088c9dadf5bc5f Mon Sep 17 00:00:00 2001 From: Ian Becker Date: Sat, 13 Dec 2025 15:14:19 -0500 Subject: [PATCH 1/9] feat(nix)!: use treefmt.nix and support in action treefmt.nix creates a wrapper which includes the toml config and all the formatters. this commit includes changes that allow the action to detect a treefmt binary in the PATH and use that instead of specifying a version this commit also includes changing the inputs from `input_name` to `input-name`, which is a breaking change for users --- .devcontainer.json | 12 ++++++++++++ .github/workflows/test.yml | 11 +++-------- 2 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 .devcontainer.json diff --git a/.devcontainer.json b/.devcontainer.json new file mode 100644 index 0000000..2f69206 --- /dev/null +++ b/.devcontainer.json @@ -0,0 +1,12 @@ +{ + "customizations": { + "vscode": { + "extensions": [ + "mkhl.direnv" + ] + } + }, + "image": "ghcr.io/cachix/devenv:latest", + "overrideCommand": false, + "updateContentCommand": "devenv test" +} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 40c3627..d4ce5f9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -81,21 +81,16 @@ jobs: verbose: ${{ matrix.test-case.verbose }} clear-cache: ${{ matrix.test-case.clear-cache }} excludes: ${{ matrix.test-case.excludes }} + init: ${{ matrix.test-case.init }} github-token: ${{ secrets.GITHUB_TOKEN }} marketplace-test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: biomejs/setup-biome@v2.6.0 - with: - version: "2.2.6" + - uses: biomejs/setup-biome@v2.2.1 - uses: uncenter/setup-taplo@v1.0.8 - name: Run treefmt Action from Marketplace - uses: isbecker/treefmt-action@v1.4.0 + uses: isbecker/treefmt-action@v1.3.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} ci: true - # TODO: update this once we push the new version - # should not need to specify, and if necessary, - # it should be "config-file" with a hyphen - config_file: .treefmt.toml From 357984f695c37a976217708c5f787727b38105a4 Mon Sep 17 00:00:00 2001 From: Ian Becker Date: Sat, 13 Dec 2025 15:18:23 -0500 Subject: [PATCH 2/9] fix(ci): make the marketplace-test case work --- .github/workflows/test.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d4ce5f9..e25b030 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -90,7 +90,11 @@ jobs: - uses: biomejs/setup-biome@v2.2.1 - uses: uncenter/setup-taplo@v1.0.8 - name: Run treefmt Action from Marketplace - uses: isbecker/treefmt-action@v1.3.0 + uses: isbecker/treefmt-action@v1.4.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} ci: true + # TODO: update this once we push the new version + # should not need to specify, and if necessary, + # it should be "config-file" with a hyphen + config_file: .treefmt.toml From ec3ba2eaf4aebcf64804a4c26e21930be7a74f5f Mon Sep 17 00:00:00 2001 From: Ian Becker Date: Sat, 13 Dec 2025 15:21:23 -0500 Subject: [PATCH 3/9] fix(ci): remove init input --- .github/workflows/test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e25b030..f090be5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -81,7 +81,6 @@ jobs: verbose: ${{ matrix.test-case.verbose }} clear-cache: ${{ matrix.test-case.clear-cache }} excludes: ${{ matrix.test-case.excludes }} - init: ${{ matrix.test-case.init }} github-token: ${{ secrets.GITHUB_TOKEN }} marketplace-test: runs-on: ubuntu-latest From 0130428acc82d434bc2c07ec758a28d03a40f37a Mon Sep 17 00:00:00 2001 From: Ian Becker Date: Sat, 13 Dec 2025 15:24:33 -0500 Subject: [PATCH 4/9] fix(ci): specify biome version explicitly in marketplace-test --- .github/workflows/test.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f090be5..40c3627 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -86,7 +86,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: biomejs/setup-biome@v2.2.1 + - uses: biomejs/setup-biome@v2.6.0 + with: + version: "2.2.6" - uses: uncenter/setup-taplo@v1.0.8 - name: Run treefmt Action from Marketplace uses: isbecker/treefmt-action@v1.4.0 From 76bf6474018f6344d19fa40c4efabbcefced19ec Mon Sep 17 00:00:00 2001 From: Ian Becker Date: Sat, 13 Dec 2025 15:52:41 -0500 Subject: [PATCH 5/9] fix(ci): remove macos from big matrix --- .github/workflows/test.yml | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 40c3627..18aaa59 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,7 +8,6 @@ jobs: matrix: os: - ubuntu-latest - - macos-latest arch: - x86_64 - arm64 @@ -82,20 +81,30 @@ jobs: clear-cache: ${{ matrix.test-case.clear-cache }} excludes: ${{ matrix.test-case.excludes }} github-token: ${{ secrets.GITHUB_TOKEN }} + macos-test: + runs-on: macos-latest + steps: + - uses: actions/checkout@v6 + - uses: biomejs/setup-biome@v2.6.0 + with: + version: "2.2.6" + - uses: uncenter/setup-taplo@v1.0.8 + - name: Run treefmt Action + uses: ./ + with: + version: latest + ci: true + github-token: ${{ secrets.GITHUB_TOKEN }} marketplace-test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: biomejs/setup-biome@v2.6.0 with: version: "2.2.6" - uses: uncenter/setup-taplo@v1.0.8 - name: Run treefmt Action from Marketplace - uses: isbecker/treefmt-action@v1.4.0 + uses: isbecker/treefmt-action@main with: github_token: ${{ secrets.GITHUB_TOKEN }} ci: true - # TODO: update this once we push the new version - # should not need to specify, and if necessary, - # it should be "config-file" with a hyphen - config_file: .treefmt.toml From dc84810a610f61260a88363187d768b24a094c72 Mon Sep 17 00:00:00 2001 From: Ian Becker Date: Sat, 13 Dec 2025 15:53:55 -0500 Subject: [PATCH 6/9] fix(ci): update inputs for marketplace-test --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 18aaa59..e098fb7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -106,5 +106,5 @@ jobs: - name: Run treefmt Action from Marketplace uses: isbecker/treefmt-action@main with: - github_token: ${{ secrets.GITHUB_TOKEN }} + github-token: ${{ secrets.GITHUB_TOKEN }} ci: true From 8d236dea32ed81658bc6f3dd0f27d6771f7b42de Mon Sep 17 00:00:00 2001 From: Ian Becker Date: Sat, 13 Dec 2025 16:21:19 -0500 Subject: [PATCH 7/9] fix(ci): only use treefmt.nix for single test not matrix --- .github/workflows/test.yml | 52 +++++++++++++++++++++++--------------- .treefmt.toml | 6 ++--- 2 files changed, 35 insertions(+), 23 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e098fb7..34de859 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,6 +8,7 @@ jobs: matrix: os: - ubuntu-latest + - macos-latest arch: - x86_64 - arm64 @@ -19,9 +20,6 @@ jobs: # however, users can leave version out to get the default behavior version: latest ci: true - - name: Use system treefmt if available - version: system - ci: true - name: Specify version 2.4.0 version: "2.4.0" ci: true @@ -30,42 +28,36 @@ jobs: version: latest config-file: .treefmt.toml - name: Allow missing formatters - version: system + version: latest allow-missing-formatter: true - name: Run in specific working directory - version: system + version: latest working-dir: . - name: Disable cache - version: system + version: latest no-cache: true - name: Do not fail on change - version: system + version: latest fail-on-change: false - name: Run specific formatters - version: system + version: latest formatters: biome,taplo - name: Increase verbosity - version: system + version: latest verbose: "2" - name: Clear cache before run - version: system + version: latest clear-cache: true - name: Exclude certain paths - version: system + version: latest excludes: docs/**,tests/** name: ${{ matrix.test-case.name }} on ${{ matrix.os }} ${{ matrix.arch }} steps: - uses: actions/checkout@v6 - - uses: DeterminateSystems/nix-installer-action@v21 - - uses: DeterminateSystems/magic-nix-cache-action@v13 + - uses: biomejs/setup-biome@v2.6.0 with: - use-flakehub: false - use-gha-cache: true - - name: Install formatting tools - shell: bash - run: | - eval "$(nix print-dev-env --no-pure-eval --accept-flake-config .#ci)" - echo "PATH=$PATH" >> "$GITHUB_ENV" + version: "2.2.6" + - uses: uncenter/setup-taplo@v1.0.8 - name: Run treefmt Action uses: ./ with: @@ -81,6 +73,26 @@ jobs: clear-cache: ${{ matrix.test-case.clear-cache }} excludes: ${{ matrix.test-case.excludes }} github-token: ${{ secrets.GITHUB_TOKEN }} + treefmt-nix-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: DeterminateSystems/nix-installer-action@v21 + - uses: DeterminateSystems/magic-nix-cache-action@v13 + with: + use-flakehub: false + use-gha-cache: true + - name: Install formatting tools + shell: bash + run: | + eval "$(nix print-dev-env --no-pure-eval --accept-flake-config .#ci)" + echo "PATH=$PATH" >> "$GITHUB_ENV" + - name: Run treefmt Action + uses: ./ + with: + version: system + ci: true + github-token: ${{ secrets.GITHUB_TOKEN }} macos-test: runs-on: macos-latest steps: diff --git a/.treefmt.toml b/.treefmt.toml index bd31bf1..324a902 100644 --- a/.treefmt.toml +++ b/.treefmt.toml @@ -1,15 +1,15 @@ allow-missing-formatter = true -formatters = ["typescript", "toml", "nix", "markdown"] +formatters = ["biome", "taplo", "nix", "markdown"] on-unmatched = "info" -[formatter.typescript] +[formatter.biome] command = "biome" options = ["format", "--write", "--no-errors-on-unmatched"] includes = ["*.ts", "*.json", "*.js", "*.jsx", "*.tsx"] excludes = ["dist/*", "node_modules/*"] -[formatter.toml] +[formatter.taplo] command = "taplo" options = [ "fmt", From 5abcc160adac4149edf7ef29364afd2088b41dc3 Mon Sep 17 00:00:00 2001 From: Ian Becker Date: Sat, 13 Dec 2025 16:22:37 -0500 Subject: [PATCH 8/9] fix(ci): remove devcontainer --- .devcontainer.json | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 .devcontainer.json diff --git a/.devcontainer.json b/.devcontainer.json deleted file mode 100644 index 2f69206..0000000 --- a/.devcontainer.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "customizations": { - "vscode": { - "extensions": [ - "mkhl.direnv" - ] - } - }, - "image": "ghcr.io/cachix/devenv:latest", - "overrideCommand": false, - "updateContentCommand": "devenv test" -} From acdfeec89bf11b09566c9ce641633f06e9179710 Mon Sep 17 00:00:00 2001 From: Ian Becker Date: Sat, 13 Dec 2025 16:23:32 -0500 Subject: [PATCH 9/9] fix(ci): remove dedicated macos test back in the matrix --- .github/workflows/test.yml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 34de859..5253d50 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -93,20 +93,6 @@ jobs: version: system ci: true github-token: ${{ secrets.GITHUB_TOKEN }} - macos-test: - runs-on: macos-latest - steps: - - uses: actions/checkout@v6 - - uses: biomejs/setup-biome@v2.6.0 - with: - version: "2.2.6" - - uses: uncenter/setup-taplo@v1.0.8 - - name: Run treefmt Action - uses: ./ - with: - version: latest - ci: true - github-token: ${{ secrets.GITHUB_TOKEN }} marketplace-test: runs-on: ubuntu-latest steps: