From fe475621d253e23d470fd984cec7223cad286c7c Mon Sep 17 00:00:00 2001 From: squat Date: Tue, 16 Sep 2025 21:30:17 +0200 Subject: [PATCH 1/2] feat: add chart-testing hook This commit introduces configuration for [chart-testing](https://github.com/helm/chart-testing), a tool for validating Helm charts. The default usage of the tool assumes that Helm charts are nested within `^charts/` at the root of the directory, and this pre-commit hook makes the same assumption. Signed-off-by: squat --- README.md | 1 + modules/hooks.nix | 9 +++++++++ nix/tools.nix | 2 ++ 3 files changed, 12 insertions(+) diff --git a/README.md b/README.md index d4a6474f..d46bd045 100644 --- a/README.md +++ b/README.md @@ -475,6 +475,7 @@ use nix - [actionlint](https://github.com/rhysd/actionlint) - [action-validator](https://github.com/mpalmer/action-validator) +- [chart-testing](https://github.com/helm/chart-testing) - [check-added-large-files](https://github.com/pre-commit/pre-commit-hooks/blob/main/pre_commit_hooks/check_added_large_files.py) - [check-case-conflicts](https://github.com/pre-commit/pre-commit-hooks/blob/main/pre_commit_hooks/check_case_conflict.py) - [check-executables-have-shebangs](https://github.com/pre-commit/pre-commit-hooks/blob/main/pre_commit_hooks/check_executables_have_shebangs.py) diff --git a/modules/hooks.nix b/modules/hooks.nix index 6c0425c1..a24ce1d2 100644 --- a/modules/hooks.nix +++ b/modules/hooks.nix @@ -2311,6 +2311,15 @@ in files = "\\.rs$"; pass_filenames = false; }; + chart-testing = + { + name = "chart-testing"; + description = "CLI tool for linting and testing Helm charts"; + files = "^charts/"; + package = tools.chart-testing; + entry = "${pkgs.chart-testing}/bin/ct lint --all --skip-helm-dependencies"; + pass_filenames = false; + }; checkmake = { name = "checkmake"; description = "Experimental linter/analyzer for Makefiles"; diff --git a/nix/tools.nix b/nix/tools.nix index 0e76215a..3b94a9eb 100644 --- a/nix/tools.nix +++ b/nix/tools.nix @@ -11,6 +11,7 @@ , cabal2nix , callPackage , cargo +, chart-testing , checkmake , circleci-cli , llvmPackages_latest @@ -121,6 +122,7 @@ in cabal-fmt cabal-gild cargo + chart-testing checkmake circleci-cli clippy From 6119758511712ef455673f39d9882008f8944958 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Serv=C3=A9n=20Mar=C3=ADn?= Date: Wed, 17 Sep 2025 07:43:31 -0400 Subject: [PATCH 2/2] Update modules/hooks.nix Co-authored-by: sander --- modules/hooks.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/hooks.nix b/modules/hooks.nix index a24ce1d2..79586517 100644 --- a/modules/hooks.nix +++ b/modules/hooks.nix @@ -2317,7 +2317,7 @@ in description = "CLI tool for linting and testing Helm charts"; files = "^charts/"; package = tools.chart-testing; - entry = "${pkgs.chart-testing}/bin/ct lint --all --skip-helm-dependencies"; + entry = "${hooks.chart-testing.package}/bin/ct lint --all --skip-helm-dependencies"; pass_filenames = false; }; checkmake = {