let sources = import ./default.nix; pkgs = import sources.nixpkgs { }; pre-commit = import sources.git-hooks; globalExcludes = [ "nix/default.nix" ".*vendor" ".*chart/.*" ".*schema.json" ]; in pre-commit.run { src = pkgs.nix-gitignore.gitignoreSource [ ] ../.; # Do not run at pre-commit time default_stages = [ "pre-push" ]; # TODO(mrtz): Remove when default package = pkgs.prek; # Linters From https://github.com/cachix/pre-commit-hooks.nix hooks = { nixfmt-rfc-style = { enable = true; excludes = globalExcludes; }; trim-trailing-whitespace.enable = true; shellcheck = { enable = true; excludes = [ "vcluster/" ]; args = [ "-x" "-o" "all" ]; }; yamllint = { enable = false; excludes = [ "attic/" "charts/templates/" "charts/charts/" ]; settings = { strict = true; configData = ''{ extends: default, rules: { document-start: disable, line-length: {max: 165} } }''; }; }; check-json.enable = true; renovate-config-validator = { enable = true; files = "renovate.json$"; entry = "renovate-config-validator"; }; }; }