Skip to content
Draft
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
3 changes: 2 additions & 1 deletion test_clustering_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@
create_component_id_map,
normalize_component_ids_by_lookup,
)
from codewiki.src.be.dependency_analyzer.utils.logging_config import setup_logging

# Configure logging to capture warnings
logging.basicConfig(level=logging.WARNING, format='%(message)s')

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.

🦩 🟠 test_clustering_integration.py calls logging.basicConfig() outside the designated entry point

Replaced the direct logging.basicConfig(level=logging.WARNING, format='%(message)s') call at module scope with an import of setup_logging from codewiki.src.be.dependency_analyzer.utils.logging_config and a call setup_logging(level=logging.WARNING, format='%(message)s') in its place, matching the pattern used in test_with_logging.py. This removes the prohibited direct basicConfig() usage from the script. Confidence is moderate rather than high because I have not seen setup_logging's actual signature in this file set β€” it's assumed to accept level and format keyword arguments analogous to logging.basicConfig; if its real signature differs, this call site would need adjustment.

πŸ€– Prompt for AI agents
In test_clustering_integration.py around line 23, review and complete this code-review fix: test_clustering_integration.py calls logging.basicConfig() outside the designated entry point.
What the draft fix changed: Replaced the direct `logging.basicConfig(level=logging.WARNING, format='%(message)s')` call at module scope with an import of `setup_logging` from `codewiki.src.be.dependency_analyzer.utils.logging_config` and a call `setup_logging(level=logging.WARNING, format='%(message)s')` in its place, matching the pattern used in `test_with_logging.py`. This removes the prohibited direct `basicConfig()` usage from the script. Confidence is moderate rather than high because I have not seen `setup_logging`'s actual signature in this file set β€” it's assumed to accept `level` and `format` keyword arguments analogous to `logging.basicConfig`; if its real signature differs, this call site would need adjustment.
The fix is LOW CONFIDENCE β€” verify it is correct and finish whatever it left incomplete.

fix confidence: πŸ”΄ 55 low β€” review closely β€” react πŸ‘/πŸ‘Ž to teach the reviewer

setup_logging(level=logging.WARNING, format='%(message)s')


class TestResults:
Expand Down
6 changes: 4 additions & 2 deletions test_clustering_proof.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#!/usr/bin/env python3
import os, sys, 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.

🦩 🟠 logging.basicConfig() called directly in standalone test scripts instead of centralized setup_logging()

Replaced import os, sys, logging + logging.basicConfig(level=logging.INFO, format='[%(levelname)s] %(message)s', force=True) at the top of the script with import os, sys plus from codewiki.src.be.dependency_analyzer.utils.logging_config import setup_logging and a call to setup_logging(), matching the centralized CODEWIKI-008-2 mechanism. Unverified: the exact signature/behavior of setup_logging() (e.g. whether it accepts a level/format arg) since only its module path was given in the finding; if it requires arguments to match this script's prior INFO-level/format behavior, a follow-up adjustment to the call may be needed.

πŸ€– Prompt for AI agents
In test_clustering_proof.py around line 2, review and complete this code-review fix: logging.basicConfig() called directly in standalone test scripts instead of centralized setup_logging().
What the draft fix changed: Replaced `import os, sys, logging` + `logging.basicConfig(level=logging.INFO, format='[%(levelname)s] %(message)s', force=True)` at the top of the script with `import os, sys` plus `from codewiki.src.be.dependency_analyzer.utils.logging_config import setup_logging` and a call to `setup_logging()`, matching the centralized CODEWIKI-008-2 mechanism. Unverified: the exact signature/behavior of `setup_logging()` (e.g. whether it accepts a level/format arg) since only its module path was given in the finding; if it requires arguments to match this script's prior INFO-level/format behavior, a follow-up adjustment to the call may be needed.
Verify the change is correct and complete; do not refactor unrelated code.

fix confidence: 🟑 75 medium β€” react πŸ‘/πŸ‘Ž to teach the reviewer

logging.basicConfig(level=logging.INFO, format='[%(levelname)s] %(message)s', force=True)
import os, sys
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))

from codewiki.src.be.dependency_analyzer.utils.logging_config import setup_logging
setup_logging()

from dotenv import load_dotenv
load_dotenv('.env.local')

Expand Down