Skip to content

Exclude OSS info correction files#271

Merged
soimkim merged 1 commit into
mainfrom
dev_info_yaml
May 19, 2026
Merged

Exclude OSS info correction files#271
soimkim merged 1 commit into
mainfrom
dev_info_yaml

Conversation

@JustinWonjaePark
Copy link
Copy Markdown
Contributor

@JustinWonjaePark JustinWonjaePark commented May 17, 2026

New Features

  • Automatic exclusion of configured OSS-info correction files from scan results. Matching files are now marked as excluded and annotated during the scanning workflow so they do not appear in final generated reports.

Review Change Stack

@JustinWonjaePark JustinWonjaePark self-assigned this May 17, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 17, 2026

Warning

Rate limit exceeded

@JustinWonjaePark has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 36 minutes before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 16d28e86-c93c-4b0d-8c9e-5db55b572dc3

📥 Commits

Reviewing files that changed from the base of the PR and between daea40a and 976c791.

📒 Files selected for processing (1)
  • src/fosslight_source/cli.py
📝 Walkthrough

Walkthrough

Adds SUPPORT_OSS_INFO_FILES and OSS_INFO_CORRECTION_COMMENT, implements mark_oss_info_correction_files_as_excluded(scan_results) to set exclude=True and a fixed comment for merged items whose lowercased basename matches configured regexes, and calls this helper in run_scanners after merge_results and before report creation.

Changes

OSS Info Correction File Exclusion

Layer / File(s) Summary
Regex import and constants
src/fosslight_source/cli.py
Adds import re, defines SUPPORT_OSS_INFO_FILES (regex patterns) and OSS_INFO_CORRECTION_COMMENT used to identify and annotate OSS-info correction files.
Exclusion helper implementation
src/fosslight_source/cli.py
Adds mark_oss_info_correction_files_as_excluded(scan_results) which lowercases each merged item's basename, matches it against SUPPORT_OSS_INFO_FILES, sets item.exclude = True, and assigns OSS_INFO_CORRECTION_COMMENT to item.comment on match.
Pipeline wiring
src/fosslight_source/cli.py
Calls the new helper in run_scanners immediately after merge_results(...) and before create_report_file(...) so excluded/commented items are applied before report generation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • soimkim
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.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 concisely describes the main change: excluding OSS info correction files from reports. It accurately reflects the primary objective of the changeset.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev_info_yaml

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.

@JustinWonjaePark JustinWonjaePark marked this pull request as draft May 17, 2026 08:49
@JustinWonjaePark JustinWonjaePark added the chore [PR/Issue] Refactoring, maintenance the code label May 17, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/fosslight_source/cli.py (1)

322-322: ⚡ Quick win

Add docstring to document the function's purpose.

Public functions should include a docstring describing their purpose, parameters, and behavior. This improves maintainability and helps other developers understand the exclusion logic.

📝 Proposed docstring
 def mark_oss_info_correction_files_as_excluded(scan_results: list) -> None:
+    """
+    Mark OSS info correction files as excluded in scan results.
+
+    Iterates through scan results and marks items whose filename matches
+    known correction filenames (case-insensitive) as excluded.
+
+    :param scan_results: List of scan result items (SourceItem instances).
+    """
     for item in scan_results:
🤖 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` at line 322, Add a descriptive docstring to the
public function mark_oss_info_correction_files_as_excluded(scan_results: list)
that states its purpose (marking correction files as excluded), documents the
parameters (scan_results: list of scan result dicts/objects and expected
structure), explains side effects/behavior (which fields are modified, e.g.,
setting an "excluded" flag or removing items), and clarifies return value (None)
and error/edge-case handling; place the docstring immediately below the def line
using triple quotes so automated docs and linters pick it up.
🤖 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.

Inline comments:
In `@src/fosslight_source/cli.py`:
- Line 327: The code currently unconditionally sets item.comment =
OSS_INFO_CORRECTION_COMMENT which overwrites any pre-existing comment; instead,
modify the logic around item.comment (the assignment using
OSS_INFO_CORRECTION_COMMENT) to preserve existing comments by appending or
merging: if item.comment is empty/None, set it to OSS_INFO_CORRECTION_COMMENT,
otherwise concatenate the existing item.comment and OSS_INFO_CORRECTION_COMMENT
with a separator (e.g., newline or " | ") so prior YAML/manual annotations are
retained; update any references around where item.comment is used to expect the
combined string.

---

Nitpick comments:
In `@src/fosslight_source/cli.py`:
- Line 322: Add a descriptive docstring to the public function
mark_oss_info_correction_files_as_excluded(scan_results: list) that states its
purpose (marking correction files as excluded), documents the parameters
(scan_results: list of scan result dicts/objects and expected structure),
explains side effects/behavior (which fields are modified, e.g., setting an
"excluded" flag or removing items), and clarifies return value (None) and
error/edge-case handling; place the docstring immediately below the def line
using triple quotes so automated docs and linters pick it up.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: bb277c93-096e-4102-b45a-4758a17a2700

📥 Commits

Reviewing files that changed from the base of the PR and between 27d43e0 and ae908e0.

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

Comment thread src/fosslight_source/cli.py
@JustinWonjaePark JustinWonjaePark marked this pull request as ready for review May 17, 2026 22:52
@JustinWonjaePark JustinWonjaePark requested review from dd-jy and soimkim May 17, 2026 23:28
Comment thread src/fosslight_source/cli.py Outdated
Comment thread src/fosslight_source/cli.py Outdated
Comment thread src/fosslight_source/cli.py Outdated
Comment thread src/fosslight_source/cli.py Outdated
@JustinWonjaePark JustinWonjaePark force-pushed the dev_info_yaml branch 2 times, most recently from 6289929 to bb8a9e0 Compare May 19, 2026 07:41
Signed-off-by: Wonjae Park <j.wonjae.park@gmail.com>
@soimkim soimkim merged commit 94056b3 into main May 19, 2026
8 checks passed
@soimkim soimkim deleted the dev_info_yaml branch May 19, 2026 21:39
@soimkim soimkim changed the title fix(report): exclude OSS info correction files Exclude OSS info correction files May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore [PR/Issue] Refactoring, maintenance the code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants