Skip to content

Commit

Permalink
chore(dev-deps): add blackdoc for docstring code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Sep 12, 2023
1 parent 78714d0 commit 5ed750f
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ repos:
rev: 23.9.1
hooks:
- id: black
- repo: https://github.com/keewis/blackdoc
rev: v0.3.8
hooks:
- id: blackdoc
exclude: ibis/examples/__init__\.py
- repo: https://github.com/codespell-project/codespell
rev: v2.2.5
hooks:
Expand Down
4 changes: 3 additions & 1 deletion docs/_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ def render(self, el: qd.ast.ExampleCode) -> str:

# if we expect failures, don't fail the notebook execution and
# render the error message
if expect_failure in first:
if expect_failure in first or any(
expect_failure in line for line in rest
):
assert (
start and end
), "expected failure should never occur alongside a skipped doctest example"
Expand Down
1 change: 1 addition & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ lock:
# format code
fmt:
black .
blackdoc .
ruff --fix .

# run all non-backend tests; additional arguments are forwarded to pytest
Expand Down
31 changes: 30 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ trino = { version = ">=0.321,<1", optional = true, extras = ["sqlalchemy"] }

[tool.poetry.group.dev.dependencies]
black = ">=22.1.0,<24"
blackdoc = ">=0.3.8,<1"
codespell = { version = ">=2.2.4,<3", extras = [
"hard-encoding-detection",
"toml",
Expand Down Expand Up @@ -477,6 +478,9 @@ required-imports = ["from __future__ import annotations"]
"docs/*.py" = ["INP001"]
"ci/release/verify_release.py" = ["T201"] # CLI tool that prints stuff

[tool.blackdoc]
extend_exclude = 'ibis/examples/__init__\.py'

[tool.black]
line_length = 88
extend_exclude = '\.direnv|result(-\d+)|_py310\.py|decompiled\.py'
Expand Down
4 changes: 3 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ beartype==0.15.0 ; python_version >= "3.10" and python_version < "4.0"
bidict==0.22.1 ; python_version >= "3.9" and python_version < "4.0"
bitarray==2.8.1 ; python_version >= "3.9" and python_version < "4.0"
black==23.9.1 ; python_version >= "3.9" and python_version < "4.0"
blackdoc==0.3.8 ; python_version >= "3.9" and python_version < "4.0"
cachetools==5.3.1 ; python_version >= "3.9" and python_version < "4.0"
certifi==2023.7.22 ; python_version >= "3.9" and python_version < "4.0"
cffi==1.15.1 ; python_version >= "3.9" and python_version < "4.0"
Expand Down Expand Up @@ -95,6 +96,7 @@ matplotlib-inline==0.1.6 ; python_version >= "3.9" and python_version < "4.0"
matplotlib==3.7.2 ; python_version >= "3.10" and python_version < "4.0"
mdurl==0.1.2 ; python_version >= "3.9" and python_version < "4.0"
mizani==0.9.2 ; python_version >= "3.10" and python_version < "4.0"
more-itertools==10.1.0 ; python_version >= "3.9" and python_version < "4.0"
multidict==6.0.4 ; python_version >= "3.9" and python_version < "4.0"
multipledispatch==1.0.0 ; python_version >= "3.9" and python_version < "4.0"
mypy-extensions==1.0.0 ; python_version >= "3.9" and python_version < "4.0"
Expand Down Expand Up @@ -200,7 +202,7 @@ tenacity==8.2.3 ; python_version >= "3.10" and python_version < "4.0"
threadpoolctl==3.2.0 ; python_version >= "3.10" and python_version < "4.0"
thrift-sasl==0.4.3 ; python_version >= "3.9" and python_version < "4.0"
thrift==0.16.0 ; python_version >= "3.9" and python_version < "4.0"
tomli==2.0.1 ; python_version >= "3.9" and python_full_version <= "3.11.0a6"
tomli==2.0.1 ; python_version >= "3.9" and python_version < "4.0"
tomlkit==0.12.1 ; python_version >= "3.9" and python_version < "4.0"
toolz==0.12.0 ; python_version >= "3.9" and python_version < "4.0"
tornado==6.3.3 ; python_version >= "3.10" and python_version < "4.0"
Expand Down

0 comments on commit 5ed750f

Please sign in to comment.