Skip to content

[pre-commit.ci] pre-commit autoupdate #64

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ exclude: ^tests/.*\.md|tests/.*\.rst|tests/.*\.xml|docs/apidocs/.*

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.4
rev: v0.11.7
hooks:
- id: ruff
args: [--fix]
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.0
rev: v1.15.0
hooks:
- id: mypy
args: [--config-file=pyproject.toml]
Expand Down
7 changes: 4 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,12 @@

import typing as t # noqa: E402

from autodoc2.config import CONFIG_PREFIX, Config, PackageConfig # noqa: E402
from docutils import nodes # noqa: E402
from sphinx.application import Sphinx # noqa: E402
from sphinx.util.docutils import SphinxDirective # noqa: E402

from autodoc2.config import CONFIG_PREFIX, Config, PackageConfig # noqa: E402


def setup(app: Sphinx) -> None:
app.add_object_type(
Expand All @@ -122,7 +123,7 @@ def run(self) -> t.List[nodes.Node]:
config = Config()
for name, value, field in config.as_triple():
text.append(f"``````{{confval}} {CONFIG_PREFIX}{name}")
text.append(f'{field.metadata.get("help", "")}')
text.append(f"{field.metadata.get('help', '')}")
text.append("")
# if "category" in field.metadata:
# text.append(f"**category**: { field.metadata['category']}")
Expand Down Expand Up @@ -156,7 +157,7 @@ def run(self) -> t.List[nodes.Node]:
pkg_config = PackageConfig("")
for name, value, field in pkg_config.as_triple():
text.append(f"``````{{confval}} {CONFIG_PREFIX}packages[{name}]")
text.append(f'{field.metadata.get("help", "")}')
text.append(f"{field.metadata.get('help', '')}")
text.append("")
type_ = type_to_string(field.type)
text.append(f"**type**: {type_}")
Expand Down
2 changes: 1 addition & 1 deletion src/autodoc2/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def list_items(
if not private and data["full_name"].split(".")[-1].startswith("_"):
continue
if one_line:
console.print(f'{data["full_name"]} ({data["type"]})')
console.print(f"{data['full_name']} ({data['type']})")
else:
console.print(data)

Expand Down
3 changes: 2 additions & 1 deletion tests/test_analyse_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@

import typing as t

from autodoc2.analysis import analyse_module
import pytest

from autodoc2.analysis import analyse_module


def clean_item(item: dict[str, t.Any]) -> dict[str, t.Any]:
"""Remove non-deterministic data."""
Expand Down
7 changes: 4 additions & 3 deletions tests/test_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@
from pathlib import Path
from textwrap import dedent

import pytest
from sphinx.testing.util import SphinxTestApp
from sphinx.testing.util import path as sphinx_path

from autodoc2.analysis import analyse_module
from autodoc2.config import Config
from autodoc2.db import InMemoryDb
from autodoc2.render.base import RendererBase
from autodoc2.render.myst_ import MystRenderer
from autodoc2.render.rst_ import RstRenderer
from autodoc2.utils import yield_modules
import pytest
from sphinx.testing.util import SphinxTestApp
from sphinx.testing.util import path as sphinx_path


@pytest.mark.parametrize(
Expand Down
Loading