Skip to content
Closed
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
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ci:

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.20
rev: v0.16.1
hooks:
- id: ruff-check
args: [--fix, --exit-non-zero-on-fix]
Expand All @@ -17,7 +17,7 @@ repos:
args: [tests]

- repo: https://github.com/codespell-project/codespell
rev: v2.4.2
rev: v2.4.3
hooks:
- id: codespell

Expand Down
2 changes: 1 addition & 1 deletion src/doc2dash/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def main(

if add_to_dash or add_to_global:
log.info("Adding to Dash...")
subprocess.check_output(("open", "-a", "dash", dest)) # noqa: S603
subprocess.check_output(("open", "-a", "dash", dest))


def setup_destination(
Expand Down
3 changes: 1 addition & 2 deletions src/doc2dash/docsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@

from __future__ import annotations

from enum import Enum

import os
import plistlib
import shutil
import sqlite3

from enum import Enum
from functools import cached_property
from pathlib import Path

Expand Down
4 changes: 2 additions & 2 deletions src/doc2dash/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ class RichEchoHandler(logging.Handler):

_level_to_fg: ClassVar[dict[int, str]] = {
logging.ERROR: "red",
logging.WARN: "yellow",
logging.WARNING: "yellow",
}

def emit(self, record: logging.LogRecord) -> None:
if record.levelno > logging.WARN: # noqa: SIM108
if record.levelno > logging.WARNING:
print = error_console.print
else:
print = console.print
Expand Down
3 changes: 1 addition & 2 deletions src/doc2dash/parsers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ def get_doctype(
name = dt.detect(path)
if name:
return dt, name
else:
return None, None
return None, None


__all__ = ["get_doctype", "types"]
3 changes: 2 additions & 1 deletion src/doc2dash/parsers/intersphinx.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@

import logging

from collections.abc import Generator, Iterator, Mapping
from contextlib import contextmanager
from pathlib import Path
from typing import ClassVar, Generator, Iterator, Mapping
from typing import ClassVar

import attrs

Expand Down
4 changes: 2 additions & 2 deletions src/doc2dash/parsers/intersphinx_inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@
import zlib

from collections import defaultdict
from collections.abc import Callable, Mapping
from pathlib import Path
from typing import Callable, Mapping, Tuple

import attrs


log = logging.getLogger(__name__)


InventoryEntry = Tuple[str, str] # (uri, display name)
InventoryEntry = tuple[str, str] # (uri, display name)


def load_inventory(source: Path) -> Mapping[str, Mapping[str, InventoryEntry]]:
Expand Down
2 changes: 1 addition & 1 deletion src/doc2dash/parsers/patcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import urllib

from collections import defaultdict
from collections.abc import Generator
from pathlib import Path
from typing import Generator

from rich.progress import Progress

Expand Down
3 changes: 2 additions & 1 deletion src/doc2dash/parsers/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@

from __future__ import annotations

from collections.abc import Generator, Iterator
from contextlib import contextmanager
from enum import Enum
from pathlib import Path
from typing import ClassVar, Generator, Iterator, Protocol
from typing import ClassVar, Protocol

import attrs

Expand Down
2 changes: 1 addition & 1 deletion tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def parse(self):
def make_patcher_for_file(self, path):
pass

class fake_module: # noqa: N801
class fake_module:
Parser = FakeParser

expected = f"""\
Expand Down