diff --git a/README.md b/README.md index d4a6474f..6c24fd3e 100644 --- a/README.md +++ b/README.md @@ -490,6 +490,7 @@ use nix - [end-of-file-fixer](https://github.com/pre-commit/pre-commit-hooks/blob/main/pre_commit_hooks/end_of_file_fixer.py) - [fix-byte-order-marker](https://github.com/pre-commit/pre-commit-hooks/blob/main/pre_commit_hooks/fix_byte_order_marker.py) - [headache](https://github.com/frama-c/headache) +- [keep-sorted](https://github.com/google/keep-sorted) - [mixed-line-endings](https://github.com/pre-commit/pre-commit-hooks/blob/main/pre_commit_hooks/mixed_line_ending.py) - [mkdocs-linkcheck](https://github.com/byrnereese/linkchecker-mkdocs) - [openapi-spec-validator](https://github.com/python-openapi/openapi-spec-validator) diff --git a/modules/hooks.nix b/modules/hooks.nix index 6c0425c1..72785b22 100644 --- a/modules/hooks.nix +++ b/modules/hooks.nix @@ -3161,6 +3161,14 @@ lib.escapeShellArgs (lib.concatMap (ext: [ "--ghc-opt" "-X${ext}" ]) hooks.fourm end' ''; }; + keep-sorted = + { + name = "keep-sorted"; + description = "Language-agnostic formatter that sorts lines between two markers in a larger file."; + types = [ "text" ]; + package = tools.keep-sorted; + entry = "${hooks.keep-sorted.package}/bin/keep-sorted"; + }; latexindent = { name = "latexindent"; diff --git a/nix/tools.nix b/nix/tools.nix index 0e76215a..41a7cbe9 100644 --- a/nix/tools.nix +++ b/nix/tools.nix @@ -42,6 +42,7 @@ , hlint , hpack , html-tidy +, keep-sorted , luaPackages , lua-language-server , lychee @@ -150,6 +151,7 @@ in hlint hpack html-tidy + keep-sorted lychee mdformat mdl