Skip to content

Commit

Permalink
FIX: do not duplicate nbstripout --extra-keys (#389)
Browse files Browse the repository at this point in the history
  • Loading branch information
redeboer authored Sep 5, 2024
1 parent 05a2162 commit 9c5f1ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/compwa_policy/check_dev_files/nbstripout.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 9c5f1ec

Please sign in to comment.