From 156b1003041b5517bec23cc8d2de846c8562e0df Mon Sep 17 00:00:00 2001 From: Jose Storopoli Date: Thu, 21 Dec 2023 07:38:34 -0300 Subject: [PATCH] feat: add typstfmt - adds typstfmt (https://github.com/astrale-sharp/typstfmt) - most of the settings were ported from https://github.com/astrale-sharp/typstfmt/blob/master/.pre-commit-hooks.yaml --- README.md | 4 ++++ modules/hooks.nix | 7 +++++++ nix/tools.nix | 2 ++ 3 files changed, 13 insertions(+) diff --git a/README.md b/README.md index abd8f55b..be033692 100644 --- a/README.md +++ b/README.md @@ -218,6 +218,10 @@ use nix - [taplo fmt](https://github.com/tamasfe/taplo) +## Typst + +- [typstfmt](https://github.com/astrale-sharp/typstfmt) + ## Fortran - [fprettify](https://github.com/pseewald/fprettify) diff --git a/modules/hooks.nix b/modules/hooks.nix index e8f202d9..139aa203 100644 --- a/modules/hooks.nix +++ b/modules/hooks.nix @@ -2234,5 +2234,12 @@ in entry = "${tools.conform}/bin/conform enforce --commit-msg-file"; stages = [ "commit-msg" ]; }; + + typstfmt = { + name = "typstfmt"; + description = "format typst"; + entry = "${tools.typstfmt}/bin/typstfmt"; + files = "\\.typ$"; + }; }; } diff --git a/nix/tools.nix b/nix/tools.nix index 4971672e..6f23ad77 100644 --- a/nix/tools.nix +++ b/nix/tools.nix @@ -63,6 +63,7 @@ , tflint , topiary ? null ## Added in nixpkgs on Dec 2, 2022 , typos +, typstfmt , yamllint , writeScript , writeText @@ -127,6 +128,7 @@ in tagref topiary typos + typstfmt yamllint ; inherit (elmPackages) elm-format elm-review elm-test;