Commit 84c76679 authored by Jan Reimes's avatar Jan Reimes
Browse files

🧹 refactor: remove dead code across config, extraction, models, and utils

Remove unused functions, methods, properties, enum members, and imports
identified by cytoscnpy static analysis:
- normalize_release_label (normalization.py)
- infer_working_groups_from_ids (parse.py)
- CacheManager.is_registered, WorkspaceMetadata.update_wiki_build_health
- HybridServerManager.is_running, MetricsTracker.metrics property
- TDocMetadata.is_valid, TDC_WORKSPACES_DIR enum member
- Unused logger/console imports in config_app, convert, fetch_tdoc
parent 845ad846
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -2,7 +2,6 @@

from __future__ import annotations

import logging
import tomllib
from pathlib import Path
from typing import Annotated, Literal
@@ -20,7 +19,6 @@ from tdoc_crawler.config.settings import ThreeGPPConfig
FormatType = Literal["toml", "yaml", "json"]

console = Console()
logger = logging.getLogger(__name__)

ConfigInitOutputOption = Annotated[
    Path,
+0 −5
Original line number Diff line number Diff line
@@ -108,11 +108,6 @@ class CacheManager:
        """Path to workspace registry JSON file."""
        return self._cache_dir / WORKSPACE_REGISTRY_FILENAME

    @classmethod
    def is_registered(cls) -> bool:
        """Check if a CacheManager instance is registered."""
        return cls._instance is not None


def resolve_cache_manager() -> CacheManager:
    """Resolve the registered CacheManager instance.
+0 −1
Original line number Diff line number Diff line
@@ -65,7 +65,6 @@ class ConfigEnvVar(StrEnum):
    TDC_AGENDA_PATTERN_EXCLUDE = "crawl.agenda_pattern_exclude"
    TDC_CHECKOUT = "crawl.checkout"
    TDC_CHECKOUT_DIR = "path.checkout_dir"
    TDC_WORKSPACES_DIR = "path.workspaces_dirname"
    TDC_VERBOSITY = "verbosity"
    TDC_USE_WHATTHESPEC = "http.use_whatthespec"

+0 −13
Original line number Diff line number Diff line
@@ -9,7 +9,6 @@ from __future__ import annotations
import json
import re
from dataclasses import dataclass, field
from datetime import UTC, datetime
from pathlib import Path
from typing import NotRequired, TypedDict

@@ -213,18 +212,6 @@ class WorkspaceMetadata:
            counts["total"] += 1
        return counts

    def update_wiki_build_health(
        self,
        page_count: int,
        failed_pages: int,
        compile_hash: str,
    ) -> None:
        """Update wiki build health metadata after a compile run."""
        self.wiki_build_timestamp = datetime.now(UTC).isoformat()
        self.wiki_page_count = page_count
        self.wiki_failed_pages = failed_pages
        self.wiki_compile_hash = compile_hash

    def list_members(self, include_inactive: bool = False) -> list[WorkspaceMember]:
        """List members of the workspace."""
        members = []
+0 −3
Original line number Diff line number Diff line
@@ -11,15 +11,12 @@ from tdoc_crawler.database.oxyde_models import TDocMetadata as OxydeTDocMetadata
from tdoc_crawler.database.tdocs import TDocDatabase
from tdoc_crawler.extraction.conversion import OFFICE_FORMATS
from tdoc_crawler.http_client import create_cached_session
from tdoc_crawler.logging import get_logger
from tdoc_crawler.models.workspaces import TDocNotFoundError
from tdoc_crawler.tdocs.models import TDocMetadata
from tdoc_crawler.tdocs.operations.checkout import checkout_tdoc, get_checkout_path
from tdoc_crawler.tdocs.sources.whatthespec import resolve_via_whatthespec
from tdoc_crawler.workspaces.utils import resolve_tdoc_checkout_path

logger = get_logger(__name__)


@dataclass
class TDocFiles:
Loading