From 842c3f225677aa55e44b94342f19c8f3e6f2be06 Mon Sep 17 00:00:00 2001 From: Isabel Date: Mon, 20 May 2024 09:24:10 +0100 Subject: feat: add prettier check (#1) * feat: prettier check * chore: use prettier to format ci file --- .github/workflows/ci.yaml | 10 +++++----- checks/prettier/package.nix | 11 +++++++++++ 2 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 checks/prettier/package.nix diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 63363e6..30ed686 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -3,13 +3,13 @@ name: CI on: push: paths: - - '.github/workflows/**' - - '**.nix' + - ".github/workflows/**" + - "**.nix" branches: [main] pull_request: paths: - - '.github/workflows/**' - - '**.nix' + - ".github/workflows/**" + - "**.nix" workflow_dispatch: jobs: @@ -25,7 +25,7 @@ jobs: - name: Install Nix uses: cachix/install-nix-action@V27 - - name: Build release.nix + - name: Build release.nix run: | nix flake check ./test \ --print-build-logs \ diff --git a/checks/prettier/package.nix b/checks/prettier/package.nix new file mode 100644 index 0000000..03be49c --- /dev/null +++ b/checks/prettier/package.nix @@ -0,0 +1,11 @@ +{ + lib, + runCommand, + root, + nodePackages, +}: +runCommand "check-prettier" {} '' + cd ${root} + ${lib.getExe nodePackages.prettier} --ignore-path '.git' --check . + touch $out +'' -- cgit v1.2.3