Skip to content

Commit

Permalink
FIX: run black-jupyter on Jupyter notbeooks only
Browse files Browse the repository at this point in the history
  • Loading branch information
redeboer committed Sep 27, 2023
1 parent f15c0a7 commit f381e33
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/repoma/check_dev_files/black.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ def _update_precommit_repo(has_notebooks: bool) -> None:
hooks=[CommentedMap(id="black")],
)
if has_notebooks:
black_jupyter = CommentedMap(id="black-jupyter", args=["--line-length=85"])
black_jupyter = CommentedMap(
id="black-jupyter",
args=["--line-length=85"],
types_or=["jupyter"],
)
expected_hook["hooks"].append(black_jupyter)
update_single_hook_precommit_repo(expected_hook)
1 change: 1 addition & 0 deletions src/repoma/utilities/precommit.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ class Hook:
language: Optional[str] = None
always_run: Optional[bool] = None
pass_filenames: Optional[bool] = None
types_or: Optional[List[str]] = None


@define
Expand Down

0 comments on commit f381e33

Please sign in to comment.