Skip to content
This repository was archived by the owner on May 12, 2026. It is now read-only.

Commit ecbdde7

Browse files
committed
style: Add comprehensive type annotations to base_modifier module
Add full type annotations to src/core/modifiers/base_modifier.py: - Add 'from __future__ import annotations' for forward references - Add TYPE_CHECKING block for PortingContext import - Add type annotations to __init__ method parameters and return type - Add type annotations to class attributes (ctx, name, logger) - Add type annotations to _find_file_recursive and _find_dir_recursive methods - Use modern Python 3.8+ union syntax (X | Y)
1 parent 60f2560 commit ecbdde7

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

src/core/modifiers/base_modifier.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
11
"""Base modifier class with common utilities."""
2+
3+
from __future__ import annotations
4+
25
import logging
36
from pathlib import Path
7+
from typing import TYPE_CHECKING
8+
9+
if TYPE_CHECKING:
10+
from src.core.context import PortingContext
411

512

613
class BaseModifier:
714
"""Base class for all modifiers with common utilities."""
8-
9-
def __init__(self, context, name: str):
10-
self.ctx = context
11-
self.name = name
12-
self.logger = logging.getLogger(name)
13-
15+
16+
def __init__(self, context: PortingContext, name: str) -> None:
17+
self.ctx: PortingContext = context
18+
self.name: str = name
19+
self.logger: logging.Logger = logging.getLogger(name)
20+
1421
def _find_file_recursive(self, root_dir: Path, filename: str) -> Path | None:
1522
"""Find a file recursively in a directory."""
1623
if not root_dir.exists():

0 commit comments

Comments
 (0)