From 215fb4950afb90157c3df007811f81511ecd2b38 Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Tue, 29 Oct 2024 14:26:15 +0100 Subject: [PATCH] FIX: create `ci` section if missing --- src/compwa_policy/check_dev_files/precommit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compwa_policy/check_dev_files/precommit.py b/src/compwa_policy/check_dev_files/precommit.py index dafe828f..158fea39 100644 --- a/src/compwa_policy/check_dev_files/precommit.py +++ b/src/compwa_policy/check_dev_files/precommit.py @@ -116,7 +116,7 @@ def _update_precommit_ci_skip(precommit: ModifiablePrecommit) -> None: non_functional_hooks = get_non_functional_hooks(precommit.document) expected_skips = sorted(set(non_functional_hooks) | set(local_hooks)) existing_skips = precommit_ci.get("skip") - if existing_skips and existing_skips != expected_skips: + if existing_skips != expected_skips: precommit_ci["skip"] = sorted(expected_skips) yaml_config = cast(CommentedMap, precommit.document) yaml_config.yaml_set_comment_before_after_key("repos", before="\n")