From dcaed43358af225dd2593b75537a01beb98563f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Reynier?= Date: Mon, 2 May 2022 13:34:45 +0200 Subject: [PATCH] feat: add pre-commit hook --- .pre-commit-entry.sh | 3 +++ .pre-commit-hooks.yaml | 7 +++++++ 2 files changed, 10 insertions(+) create mode 100755 .pre-commit-entry.sh create mode 100644 .pre-commit-hooks.yaml diff --git a/.pre-commit-entry.sh b/.pre-commit-entry.sh new file mode 100755 index 0000000..3577577 --- /dev/null +++ b/.pre-commit-entry.sh @@ -0,0 +1,3 @@ +#! /usr/bin/env sh + +nix run github:kamadorueda/alejandra -- -q "$@" diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml new file mode 100644 index 0000000..af03c1a --- /dev/null +++ b/.pre-commit-hooks.yaml @@ -0,0 +1,7 @@ +- id: alejandra + name: alejandra + description: Format Nix code with Alejandra. + entry: .pre-commit-entry.sh + language: script + files: \.nix$ + minimum_pre_commit_version: 1.18.1