The Terragrunt builtins now catch errors in shared HCL files, kubeconform can be retargeted without breaking its bundled tests, and hk test explains itself when a step's filters exclude every file a test writes. Note that the Terragrunt builtins now require terragrunt 1.0.8 or newer.
Fixed
terragrunt_hcl_validatecatches errors in shared HCL includes (#1371, @sassdavid). Previously the step ran--working-dironce per selected directory, so editing a shared file outside every unit directory (one reached only viaincludeorread_terragrunt_config) validated nothing and passed. Bothterragrunt_hcl_validateandterragrunt_hcl_fmtnow run a single terragrunt process scoped with--filter; validate adds a directory filter and areading=filter per selected file so unit configs and shared includes are both covered. On a 39-unit repository this cutfmtfrom 1650ms to 91ms andvalidatefrom 5680ms to 1475ms. Requires terragrunt 1.0.8+, the first release where--filterworks onhcl fmtandhcl validate.hk testreports when a step's filters exclude a test's files (#1373, @sassdavid). When a test omitsfiles, hk derives them from the test'swritekeys and applies the step'sglob/types/exclude/match_anyfilters. If nothing survived, the command still ran with an empty file list and failed in a tool-specific way (for example kubeconform complaining about stdin). The test now fails up front withthe step's file filters excluded all N file(s) written by this test; set the test's files explicitly, or reset tests when overriding a builtin's glob. Tests that setfiles, write nothing, or belong to steps without filters are unaffected, andcode=is now only printed when a command actually ran.- Pkl evaluator update: hk's bundled Pkl evaluator (pklr) moves from 2.0.1 to 2.0.4, which preserves lexical scope across object amendments and keeps field-pruned import views intact while evaluating object and mapping amendments (#1380, #1381).
Changed
-
kubeconformgainsdirs,test_dir, andextra_excludes(#1372, @sassdavid). Replacing the builtin'sglobto cover layouts such as Flux'sapps/orclusters/used to filter away every file its own tests wrote, forcing users to delete the inheritedtestsblock. The builtin now derives its glob, excludes, and test paths from three options; defaults are unchanged.steps { ["kubeconform"] = (Builtins.kubeconform) { dirs = List("apps", "clusters") // List() selects every YAML file extra_excludes = List("**/custom.yaml") // appended to the Helm/kustomize defaults } }
Set
test_dirwhen replacinggloboutright so the bundled tests still write into a selected path. Preferextra_excludesoverexclude, which replaces the defaults and re-admits Helmtemplates/,values.yaml, andkustomization.yamlfiles.
Documentation
- Global mise hook installation is now the recommended setup (#1376, @jdx). On Git 2.54+,
hk install --global --miseinstalls the launcher once per machine, records mise's path at install time, and is a no-op in repositories without hk configuration.hk install --miseremains documented for repository-scoped installs on any supported Git version but needs mise on Git's runtimePATH. To switch scopes, runhk uninstallthenhk install --global --mise. The misepostinstall = "hk install --mise"recipe is removed from the main setup flow. - Top-level
stepsis optional (#1370, @jdx). The v2 migration guide no longer reads as if moving steps to the top level is required; hook-only configurations and shared local mappings remain supported. The README, getting started, configuration, Pkl guides, and downloadable examples now use a singlesteps { ... }block, and staging guidance reflects thathk fixleaves changes unstaged unless--stageis passed.
Full Changelog: v2.0.0...v2.0.1
💚 Sponsor hk
hk is built and maintained by @jdx, an open source developer at entire.io, the title sponsor of his open source work.
If hk speeds up your pre-commit loop or makes linting less painful, please consider becoming an individual or company sponsor. Your support funds ongoing development and helps keep hk fast, free, and independent.