From 85d84607b2d4a28178f2ec0238ac5eed8e39cd71 Mon Sep 17 00:00:00 2001 From: awwpotato Date: Fri, 4 Jul 2025 06:55:46 -0700 Subject: [PATCH] flake: sort pre-commit hooks and formatters (#1586) --- flake/default.nix | 32 ++++++++++++++++++-------------- flake/pre-commit.nix | 7 +++---- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/flake/default.nix b/flake/default.nix index eb3d29b0..eaef7b99 100644 --- a/flake/default.nix +++ b/flake/default.nix @@ -14,11 +14,13 @@ # dev flake is partitioned formatter = pkgs.treefmt.withConfig { runtimeInputs = with pkgs; [ - nixfmt-rfc-style + # keep-sorted start biome + keep-sorted + nixfmt-rfc-style ruff stylish-haskell - keep-sorted + # keep-sorted end ]; settings = { @@ -26,10 +28,7 @@ tree-root-file = "flake.nix"; formatter = { - stylish-haskell = { - command = "stylish-haskell"; - includes = [ "*.hx" ]; - }; + # keep-sorted start block=yes biome = { command = "biome"; options = [ @@ -55,6 +54,15 @@ "modules/swaync/base.css" ]; }; + keep-sorted = { + command = "keep-sorted"; + includes = [ "*" ]; + }; + nixfmt = { + command = "nixfmt"; + options = [ "--width=80" ]; + includes = [ "*.nix" ]; + }; ruff = { command = "ruff"; options = [ @@ -66,15 +74,11 @@ ]; includes = [ "*.py" ]; }; - nixfmt = { - command = "nixfmt"; - options = [ "--width=80" ]; - includes = [ "*.nix" ]; - }; - keep-sorted = { - command = "keep-sorted"; - includes = [ "*" ]; + stylish-haskell = { + command = "stylish-haskell"; + includes = [ "*.hx" ]; }; + # keep-sorted end }; }; }; diff --git a/flake/pre-commit.nix b/flake/pre-commit.nix index ba42849c..72e04326 100644 --- a/flake/pre-commit.nix +++ b/flake/pre-commit.nix @@ -11,20 +11,18 @@ check.enable = true; settings.hooks = { + # keep-sorted start block=yes deadnix = { enable = true; settings.noUnderscore = true; }; - editorconfig-checker.enable = true; hlint.enable = true; - + statix.enable = true; treefmt = { enable = true; package = config.formatter; }; - - statix.enable = true; typos = { enable = true; settings.configuration = '' @@ -33,6 +31,7 @@ ''; }; yamllint.enable = true; + # keep-sorted end }; }; };