Skip to content

Commit

Permalink
black -> ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
mhils committed Dec 13, 2023
1 parent dda9202 commit 3be8aa3
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- run: pip install --no-deps -e .

- run: ruff --fix-only .
- run: black .
- run: ruff format .

- run: git checkout test/testdata/ pdoc/markdown2/
- run: test/test_snapshot.py
Expand Down
4 changes: 3 additions & 1 deletion pdoc/doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,9 @@ def signature(self) -> inspect.Signature:
)
)
for p in sig.parameters.values():
p._annotation = safe_eval_type(p.annotation, globalns, localns, mod, self.fullname) # type: ignore
p._annotation = safe_eval_type(
p.annotation, globalns, localns, mod, self.fullname
) # type: ignore
return sig

@cached_property
Expand Down
4 changes: 1 addition & 3 deletions pdoc/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,7 @@ def mock_some_common_side_effects():
"os.startfile", new=_noop, create=True
), patch("sys.stdout", new=io.StringIO()), patch(
"sys.stderr", new=io.StringIO()
), patch(
"sys.stdin", new=io.StringIO()
):
), patch("sys.stdin", new=io.StringIO()):
yield


Expand Down
6 changes: 1 addition & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ pdoc = "pdoc.__main__:cli"
dev = [
"tox",
"ruff",
"black",
"mypy",
"types-pygments",
"pytest",
Expand Down Expand Up @@ -90,9 +89,6 @@ markers = [
"slow: marks tests as slow.",
]

[tool.black]
extend-exclude = "test/testdata/demo.py"

[[tool.mypy.overrides]]
module = "pytest.*"
ignore_missing_imports = true
Expand All @@ -102,7 +98,7 @@ module = "demopackage2"
ignore_missing_imports = true

[tool.ruff]
line-length = 140
extend-exclude = ["test/testdata/demo.py"]
select = ["E", "F", "I"]

[tool.ruff.isort]
Expand Down
24 changes: 7 additions & 17 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,30 +1,26 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile --all-extras --allow-unsafe --output-file=requirements-dev.txt pyproject.toml
#
attrs==23.1.0
# via hypothesis
black==23.11.0
# via pdoc (pyproject.toml)
cachetools==5.3.2
# via tox
chardet==5.2.0
# via tox
click==8.1.7
# via black
colorama==0.4.6
# via tox
coverage[toml]==7.3.2
# via pytest-cov
distlib==0.3.7
distlib==0.3.8
# via virtualenv
filelock==3.13.1
# via
# tox
# virtualenv
hypothesis==6.91.0
hypothesis==6.92.0
# via pdoc (pyproject.toml)
iniconfig==2.0.0
# via pytest
Expand All @@ -37,22 +33,16 @@ markupsafe==2.1.3
mypy==1.7.1
# via pdoc (pyproject.toml)
mypy-extensions==1.0.0
# via
# black
# mypy
# via mypy
packaging==23.2
# via
# black
# pyproject-api
# pytest
# tox
pathspec==0.11.2
# via black
pdoc-pyo3-sample-library==1.0.11
# via pdoc (pyproject.toml)
platformdirs==4.0.0
platformdirs==4.1.0
# via
# black
# tox
# virtualenv
pluggy==1.3.0
Expand All @@ -72,7 +62,7 @@ pytest-cov==4.1.0
# via pdoc (pyproject.toml)
pytest-timeout==2.2.0
# via pdoc (pyproject.toml)
ruff==0.1.6
ruff==0.1.8
# via pdoc (pyproject.toml)
sortedcontainers==2.4.0
# via hypothesis
Expand All @@ -84,7 +74,7 @@ types-pygments==2.17.0.0
# via pdoc (pyproject.toml)
types-setuptools==69.0.0.0
# via types-pygments
typing-extensions==4.8.0
typing-extensions==4.9.0
# via mypy
virtualenv==20.25.0
# via tox
4 changes: 1 addition & 3 deletions test/testdata/demopackage/subpackage/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@

from ..child_b import B

__all__ = [
"B"
]
__all__ = ["B"]
6 changes: 5 additions & 1 deletion test/testdata/math_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
https://github.com/mitmproxy/pdoc/issues/639
"""


def test_stars():
r"""
Markdown emphasis tokens (`*`) should not be captured in math mode.
Expand All @@ -15,6 +16,7 @@ def test_stars():
"""


def test_math_newline():
r"""
Markdown should not consume double backslashes (math newlines) in math mode.
Expand All @@ -38,10 +40,11 @@ def test_math_newline():
$$
"""


def test_markdown_newline():
r"""
Markdown newlines (`\n\n`) should not emit a paragraph break in math mode.
Currently broken:
$$
Expand All @@ -59,6 +62,7 @@ def test_markdown_newline():
$$
"""


def test_macros():
r"""
Markdown should not capture headings (`#`) in math mode.
Expand Down

0 comments on commit 3be8aa3

Please sign in to comment.