-
Notifications
You must be signed in to change notification settings - Fork 0
Improve logger #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve logger #27
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances logging output and CLI formatting by replacing emoji prefixes with styled text labels, introducing a custom log formatter, and adding monorepo support.
- Introduce
ShortNameFormatterfor concise logger names and configure colored output viacolorama. - Replace emoji prefixes in CLI commands with
click.stylecolored labels (e.g.,SUCCESS:,ERROR:,WARNING:). - Add
monorepoflag toCodeQLAnalysisRequest, use case logic, and CLI invocation.
Reviewed Changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/test_cli.py | Updated assertions to expect styled text labels instead of emojis for CLI output. |
| src/codeql_wrapper/infrastructure/logger.py | Added ShortNameFormatter and updated logger configuration to use the custom formatter. |
| src/codeql_wrapper/domain/use_cases/codeql_analysis_use_case.py | Implemented monorepo analysis logic in CodeQLAnalysisUseCase. |
| src/codeql_wrapper/domain/entities/codeql_analysis.py | Added monorepo attribute to CodeQLAnalysisRequest. |
| src/codeql_wrapper/cli.py | Initialized colorama, replaced emoji outputs with click.style labels, and passed monorepo. |
| pyproject.toml | Bumped version to 0.1.4 and added colorama dependency. |
| SECURITY.md | Added security issue reporting guidelines. |
| LICENSE | Updated copyright holder. |
Comments suppressed due to low confidence (3)
src/codeql_wrapper/infrastructure/logger.py:9
- [nitpick] The docstring mentions "class name" but the formatter actually shortens the logger name (module path). Update the description to refer to the "logger name" for clarity.
"""Custom formatter that shows only the class name instead of full module path."""
tests/test_cli.py:1
- [nitpick] Monorepo support was added to the CLI but there are no tests for the new
--monorepoflag. Consider adding tests that invokeanalyze --monorepoand verify the monorepo logic.
"""Tests for the CLI module."""
tests/test_cli.py:144
- Tests assert plain "SUCCESS:" text, but
click.stylewraps it with ANSI color codes. As written, the substring may not match. Consider stripping ANSI codes inresult.outputor disabling color output in tests (e.g.,CliRunner(color=False)).
assert "SUCCESS: CodeQL 2.22.1 installed successfully!" in result.output
| output_directory=Path(output_dir) if output_dir else None, | ||
| verbose=verbose, | ||
| force_install=force_install, | ||
| monorepo=monorepo, |
Copilot
AI
Jul 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The analyze command passes monorepo=monorepo, but no --monorepo option is defined in the Click decorator. This will cause a NameError. Add a @click.option('--monorepo', is_flag=True, help='Enable monorepo analysis') above the analyze definition.
No description provided.