Skip to content

Prevent mutation of shared excluded_files list#275

Merged
bjk7119 merged 1 commit into
mainfrom
excludebin
May 28, 2026
Merged

Prevent mutation of shared excluded_files list#275
bjk7119 merged 1 commit into
mainfrom
excludebin

Conversation

@bjk7119
Copy link
Copy Markdown
Contributor

@bjk7119 bjk7119 commented May 28, 2026

Summary by CodeRabbit

  • Bug Fixes

    • Improved file exclusion tracking during source code scanning to separately handle binary file exclusions, ensuring more accurate exclusion patterns and reducing potential scanning errors.
  • Chores

    • Enhanced debug logging for file exclusion operations to aid in troubleshooting scan behavior.

Review Change Stack

@bjk7119 bjk7119 requested review from JustinWonjaePark and dd-jy May 28, 2026 07:45
@bjk7119 bjk7119 self-assigned this May 28, 2026
@bjk7119 bjk7119 added the bug fix [PR] Fix the bug label May 28, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d9fc7ff9-c4ad-43fb-9fe2-9548ff0a88eb

📥 Commits

Reviewing files that changed from the base of the PR and between 62f153e and e5f559b.

📒 Files selected for processing (1)
  • src/fosslight_source/run_scancode.py

📝 Walkthrough

Walkthrough

The run_scan function's directory scanning exclusion logic now separates binary exclusion tracking from other file exclusions. A dedicated binary_files_to_exclude list is initialized before scanning and collects excluded binaries during traversal, then combined with existing excluded files into the final ignore patterns.

Changes

Binary exclusion tracking refactor

Layer / File(s) Summary
Separate binary exclusion tracking
src/fosslight_source/run_scancode.py
Initialize binary_files_to_exclude list before scanning, append excluded binaries into that separate list (replacing previous reuse of excluded_files), and combine both lists into total_files_to_excluded ignore patterns.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested labels

chore

Suggested reviewers

  • dd-jy
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: preventing mutation of a shared excluded_files list, which aligns with the summary showing that binary file exclusions are now tracked separately to avoid modifying the original excluded_files list.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch excludebin

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@bjk7119 bjk7119 merged commit 070ab49 into main May 28, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug fix [PR] Fix the bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants