Skip to content
Draft
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 codewiki/src/be/dependency_analyzer/analysis/repo_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@
import os
import fnmatch
import json
import logging
from pathlib import Path
from typing import Dict, List, Optional, Union
from codewiki.src.be.dependency_analyzer.utils.patterns import DEFAULT_IGNORE_PATTERNS, DEFAULT_INCLUDE_PATTERNS

logger = logging.getLogger(__name__)


class RepoAnalyzer:
def __init__(
Expand Down Expand Up @@ -67,9 +70,6 @@ def _analyze_multiple_repositories(self, repo_dirs: List[str]) -> Dict:
Returns:
Dictionary with merged file_tree and combined summary
"""
import logging

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🦩 🟠 repo_analyzer.py imports logging module-locally inside a method instead of module-level logger

Moved import logging and logger = logging.getLogger(__name__) out of _analyze_multiple_repositories method body to module level (top of file, after imports), creating a single module-level logger used by all log calls in that method. This satisfies CODEWIKI-005/007-2 and makes the logger available for reuse by any other function in this module.

🤖 Prompt for AI agents
In codewiki/src/be/dependency_analyzer/analysis/repo_analyzer.py around line 70, review and complete this code-review fix: repo_analyzer.py imports logging module-locally inside a method instead of module-level logger.
What the draft fix changed: Moved `import logging` and `logger = logging.getLogger(__name__)` out of `_analyze_multiple_repositories` method body to module level (top of file, after imports), creating a single module-level `logger` used by all log calls in that method. This satisfies CODEWIKI-005/007-2 and makes the logger available for reuse by any other function in this module.
Verify the change is correct and complete; do not refactor unrelated code.

fix confidence: 🟢 95 high — react 👍/👎 to teach the reviewer

logger = logging.getLogger(__name__)

logger.info(f"🔍 Analyzing {len(repo_dirs)} repository paths...")

merged_children = []
Expand Down