about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2022-06-28 08:56:33 -0700
committerFranck Cuny <franck@fcuny.net>2022-07-02 14:38:50 -0700
commit1ad6a788086cacddc9ce8861b880d17257925b5f (patch)
treef1fc87708e575641bfd5fa208417411bfdf5354c
parentfix(new-lines): add or remove new lines where needed (diff)
downloadworld-1ad6a788086cacddc9ce8861b880d17257925b5f.tar.gz
feat(flake): add more pre-commit hooks
Add pre-commit hooks for:
- trailing white spaces
- new lines at the end of files

Change-Id: I02b5c125064b1cc43e3dfcd7504f60df50846c36
Reviewed-on: https://cl.fcuny.net/c/world/+/593
Tested-by: CI
Reviewed-by: Franck Cuny <franck@fcuny.net>
-rw-r--r--flake.nix12
1 files changed, 12 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
index e36b4ed..a77cff1 100644
--- a/flake.nix
+++ b/flake.nix
@@ -73,6 +73,18 @@
               src = ./.;
 
               hooks = {
+                trailing-whitespace = {
+                  enable = true;
+                  entry = "${pkgs.python3Packages.pre-commit-hooks}/bin/trailing-whitespace-fixer";
+                  types = [ "text" ];
+                };
+
+                end-of-file-fixer = {
+                  enable = true;
+                  entry = "${pkgs.python3Packages.pre-commit-hooks}/bin/end-of-file-fixer";
+                  types = [ "text" ];
+                };
+
                 nixpkgs-fmt = {
                   enable = true;
                 };