ci: limit lefthook logging
This commit is contained in:
@@ -73,6 +73,7 @@ outputs = { self, nixpkgs, repo-lib, ... }:
|
||||
- merged `packages` and `apps` from `perSystem`
|
||||
|
||||
Checks are installed through `lefthook`, with `pre-commit` and `pre-push` commands configured to run in parallel.
|
||||
repo-lib also sets Lefthook `output = [ "failure" "summary" ]` by default.
|
||||
|
||||
For advanced Lefthook features, use raw `config.lefthook` or `perSystem.lefthook`. Those attrsets are merged after generated checks, so you can augment a generated command with fields that the simple `checks` abstraction does not carry, such as `stage_fixed`:
|
||||
|
||||
|
||||
@@ -425,6 +425,12 @@ let
|
||||
inherit src;
|
||||
config = lib.foldl' lib.recursiveUpdate { } (
|
||||
[
|
||||
{
|
||||
output = [
|
||||
"failure"
|
||||
"summary"
|
||||
];
|
||||
}
|
||||
(parallelHookStageConfig "pre-commit")
|
||||
(parallelHookStageConfig "pre-push")
|
||||
(lib.setAttrByPath [ "pre-commit" "commands" "treefmt" ] {
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
|
||||
# These checks become lefthook commands in the generated `lefthook.yml`.
|
||||
# repo-lib runs `pre-commit` and `pre-push` hook commands in parallel.
|
||||
# It also sets `output = [ "failure" "summary" ]` by default.
|
||||
checks = {
|
||||
tests = {
|
||||
command = "echo 'No tests defined yet.'";
|
||||
|
||||
@@ -1258,6 +1258,7 @@ run_mk_repo_lefthook_case() {
|
||||
run_capture_ok "$case_name: lefthook.yml derivation show failed" bash -c 'nix derivation show "$1" >"$2"' _ "$lefthook_yml_drv" "$lefthook_yml_json"
|
||||
assert_contains '\"pre-push\":{\"commands\":{\"tests\":{' "$lefthook_yml_json" "$case_name: generated check missing from pre-push"
|
||||
assert_contains 'repo-lib-check-tests' "$lefthook_yml_json" "$case_name: generated check command missing from lefthook config"
|
||||
assert_contains '\"output\":[\"failure\",\"summary\"]' "$lefthook_yml_json" "$case_name: lefthook output config missing"
|
||||
assert_contains '\"stage_fixed\":true' "$lefthook_yml_json" "$case_name: stage_fixed missing from lefthook config"
|
||||
|
||||
rm -rf "$workdir"
|
||||
|
||||
Reference in New Issue
Block a user