From 76b28c4ee18c19ef37d3d4443ef01cb6b97f405e Mon Sep 17 00:00:00 2001 From: Alejandro Angulo Date: Sun, 18 Sep 2022 22:28:50 -0700 Subject: [PATCH] Added pre-commit config --- .github/workflows/test.yml | 4 +++- .pre-commit-config.yaml | 12 ++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 .pre-commit-config.yaml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f2031aa..c6923d6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,6 +20,8 @@ jobs: - name: Calculate build matrix id: set-matrix run: | + # Use `-c` flag with jq for compact output (doesn't keep newlines in + # output which was causing issues when setting the output matrix=$(nix flake show --json | jq -c '.nixosConfigurations | keys') echo "::set-output name=matrix::$matrix" @@ -30,7 +32,7 @@ jobs: - calculate-matrix strategy: fail-fast: false - matrix: + matrix: target: "${{ fromJson(needs.calculate-matrix.outputs.matrix) }}" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..ae4a755 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,12 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.3.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-added-large-files + - repo: https://github.com/kamadorueda/alejandra + rev: 3.0.0 + hooks: + - id: alejandra-system