Skip to content

Commit

Permalink
Merge pull request #459 from gauge-sh/fix-up-dep-report
Browse files Browse the repository at this point in the history
Fix up deprecated report
  • Loading branch information
caelean authored Dec 7, 2024
2 parents 6b88b51 + 5a78bee commit 08f71cb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
6 changes: 3 additions & 3 deletions python/tach/check_external.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@


@dataclass
class ExternalCheckDiagnosticts:
class ExternalCheckDiagnostics:
undeclared_dependencies: dict[str, list[str]]
unused_dependencies: dict[str, list[str]]

Expand All @@ -34,7 +34,7 @@ def check_external(
project_root: Path,
project_config: ProjectConfig,
exclude_paths: list[str],
) -> ExternalCheckDiagnosticts:
) -> ExternalCheckDiagnostics:
serialized_source_roots = [
str(project_root / source_root) for source_root in project_config.source_roots
]
Expand Down Expand Up @@ -82,7 +82,7 @@ def check_external(
if dependencies:
filtered_unused_dependencies[filepath] = list(dependencies)

return ExternalCheckDiagnosticts(
return ExternalCheckDiagnostics(
undeclared_dependencies=filtered_undeclared_dependencies,
unused_dependencies=filtered_unused_dependencies,
)
Expand Down
12 changes: 7 additions & 5 deletions python/tach/modularity.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
import re
from dataclasses import asdict, dataclass, field
from http.client import HTTPConnection, HTTPSConnection
from pathlib import Path
from typing import Any
from typing import TYPE_CHECKING, Any
from urllib import parse

from tach import filesystem as fs
Expand All @@ -21,6 +20,9 @@
from tach.filesystem.git_ops import get_current_branch_info
from tach.parsing import extend_and_validate

if TYPE_CHECKING:
from pathlib import Path


def export_report(
project_root: Path,
Expand Down Expand Up @@ -142,7 +144,7 @@ class ErrorInfo:

@dataclass
class BoundaryError:
file_path: Path
file_path: str
line_number: int
import_mod_path: str
error_info: ErrorInfo
Expand Down Expand Up @@ -263,7 +265,7 @@ def process_check_result(check_diagnostics: CheckDiagnostics) -> CheckResult:
return CheckResult(
errors=[
BoundaryError(
file_path=error.file_path,
file_path=str(error.file_path),
line_number=error.line_number,
import_mod_path=error.import_mod_path,
error_info=ErrorInfo(
Expand All @@ -275,7 +277,7 @@ def process_check_result(check_diagnostics: CheckDiagnostics) -> CheckResult:
],
deprecated_warnings=[
BoundaryError(
file_path=Path(warning.file_path),
file_path=str(warning.file_path),
line_number=warning.line_number,
import_mod_path=warning.import_mod_path,
error_info=ErrorInfo(
Expand Down

0 comments on commit 08f71cb

Please sign in to comment.