From 50d3c65b3a2e1190746dc200d24c26d1983fdb96 Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Thu, 5 Sep 2024 21:53:03 +0200 Subject: [PATCH] FIX: do not duplicate `nbstripout` `--extra-keys` --- src/compwa_policy/check_dev_files/nbstripout.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compwa_policy/check_dev_files/nbstripout.py b/src/compwa_policy/check_dev_files/nbstripout.py index f2b3437e..4c7f0b45 100644 --- a/src/compwa_policy/check_dev_files/nbstripout.py +++ b/src/compwa_policy/check_dev_files/nbstripout.py @@ -42,8 +42,8 @@ def main(precommit: ModifiablePrecommit, allowed_cell_metadata: list[str]) -> No existing_hooks = repo["hooks"] if existing_hooks: args = existing_hooks[0].get("args", []) - if len(args) >= 2: # noqa: PLR2004 - existing_keys = {line.strip() for line in args[1].split("\n")} + if len(args) >= 3: # noqa: PLR2004 + existing_keys = {line.strip() for line in args[2].split("\n")} existing_keys = {key for key in existing_keys if key} extra_keys_argument.update(existing_keys) expected_repo = Repo(