Skip to content

Classify damaged archives with python-magic - #218

Merged
bjk7119 merged 1 commit into
mainfrom
simple
Sep 16, 2026
Merged

bjk7119 merged 1 commit into
mainfrom
simple

Conversation

@bjk7119

@bjk7119 bjk7119 commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Bug Fixes
    • Improved detection of compressed and archive files using additional file-type detection.
    • Updated source archive exclusion matching to reliably identify files ending in sources.jar.

@bjk7119
bjk7119 requested a review from soimkim September 11, 2026 06:48
@bjk7119 bjk7119 self-assigned this Sep 11, 2026
@bjk7119 bjk7119 added the chore [PR/Issue] Refactoring, maintenance the code label Sep 11, 2026
@coderabbitai

coderabbitai Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Warning

Review limit reached

Next included review available in 37 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: c504b632-2a2e-406f-a4b1-8d8d22453149

📥 Commits

Reviewing files that changed from the base of the PR and between 0dd56ff and 9e03473.

📒 Files selected for processing (1)
  • src/fosslight_binary/_simple_mode.py

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 1440ada6-fc98-4dc9-bf17-67c29a3e71d3

📥 Commits

Reviewing files that changed from the base of the PR and between ec0f039 and 0dd56ff.

📒 Files selected for processing (1)
  • src/fosslight_binary/_simple_mode.py

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The change adds libmagic fallback detection for compressed files and replaces regular-expression matching with suffix matching for sources JAR paths.

Changes

Simple mode classification

Layer / File(s) Summary
Compression detection fallback
src/fosslight_binary/_simple_mode.py
is_compressed_file checks libmagic results after ZIP and TAR checks fail. It returns False when detection raises an exception.
Sources JAR matching
src/fosslight_binary/_simple_mode.py
exclude_bin_for_simple_mode uses endswith('sources.jar') instead of regular expressions.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Merge Risk: ⚪ Minimal · up to 0dd56

The simple-mode classification changes do not leave an actionable merge-blocking risk.

🚥 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%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files. 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: using python-magic to classify damaged archives.
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.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch simple

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.

@soimkim soimkim left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

magic을 check_binary 때 실행한 결과를 이용하면 효율성이 더 높아질 것으로 보입니다.

Comment thread src/fosslight_binary/_simple_mode.py Outdated
@bjk7119
bjk7119 merged commit 2277ecb into main Sep 16, 2026
7 checks passed
@soimkim
soimkim deleted the simple branch September 27, 2026 23:34
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