Conversation
Pass ui_mode through to run_scan so UI mode receives all scanned files instead of findings-only ScanCode output.
📝 WalkthroughWalkthroughAdds a ChangesUI Mode Scan Routing
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant CLI
participant run_scanners
participant run_scan
participant Scancode
CLI->>CLI: Parse --ui into ui_mode
CLI->>run_scanners: Pass ui_mode
run_scanners->>run_scan: Pass ui_mode
run_scan->>Scancode: Set only_findings to not ui_mode
Scancode-->>run_scan: Return scan results
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
When --ui is set, retain ScanCode file items even if no license was detected so UI results include the full file list.
There was a problem hiding this comment.
🧹 Nitpick comments (3)
src/fosslight_source/cli.py (1)
526-527: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDocument the new
ui_modeparameter.Add a
:param ui_mode:entry to therun_scannersdocstring describing that UI mode requests all scanned files rather than findings-only output.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/fosslight_source/cli.py` around lines 526 - 527, Update the run_scanners docstring to add a :param ui_mode: entry, documenting that enabling UI mode requests all scanned files instead of findings-only output.src/fosslight_source/run_scancode.py (2)
273-277: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAvoid the mutable
excluded_filesdefault.Ruff flags
excluded_files: list = [](B006). Use aNonedefault and initialize a fresh list insiderun_scan()so callers cannot share mutable state across invocations.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/fosslight_source/run_scancode.py` around lines 273 - 277, Update the run_scan() signature to use None instead of a mutable default for excluded_files, then initialize it to a new empty list inside run_scan() when no value is provided, preserving caller-supplied lists.Source: Linters/SAST tools
375-379: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAdd regression coverage for both scan scopes.
Verify that the default path passes
only_findings=Trueand thatui_mode=Truepassesonly_findings=False; the existing downstream test only exercises the findings-only case.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/fosslight_source/run_scancode.py` around lines 375 - 379, Extend the tests covering the scan invocation to assert that the default path passes only_findings=True and that the ui_mode=True path passes only_findings=False. Reuse the existing downstream scan test setup and add coverage for both scan scopes without changing the runtime behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/fosslight_source/cli.py`:
- Around line 526-527: Update the run_scanners docstring to add a :param
ui_mode: entry, documenting that enabling UI mode requests all scanned files
instead of findings-only output.
In `@src/fosslight_source/run_scancode.py`:
- Around line 273-277: Update the run_scan() signature to use None instead of a
mutable default for excluded_files, then initialize it to a new empty list
inside run_scan() when no value is provided, preserving caller-supplied lists.
- Around line 375-379: Extend the tests covering the scan invocation to assert
that the default path passes only_findings=True and that the ui_mode=True path
passes only_findings=False. Reuse the existing downstream scan test setup and
add coverage for both scan scopes without changing the runtime behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: c00df291-13fb-496f-85de-35a7a99d7e5a
📒 Files selected for processing (2)
src/fosslight_source/cli.pysrc/fosslight_source/run_scancode.py
Pass ui_mode through to run_scan so UI mode receives all scanned files instead of findings-only ScanCode output.