Skip to content

fix(oss_item): preserve copyright statement order - #315

Merged
soimkim merged 3 commits into
mainfrom
fix/copyright-order
Sep 30, 2026
Merged

soimkim merged 3 commits into
mainfrom
fix/copyright-order

Conversation

@soimkim

@soimkim soimkim commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • OssItem.copyright deduplicated statements with set(), whose iteration order follows PYTHONHASHSEED.
    • The same copyright lines (for example the two LG Electronics notices in README.md) were therefore emitted in a different order on each process, which showed up as a PyPI-install vs git-install difference.

set() iteration follows PYTHONHASHSEED, so the same copyright
lines were reported in a different order on each run.
@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: fosslight/fosslight_util/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 3d3c86d8-e8f0-4df3-84c9-fb5f6ea2a617

📥 Commits

Reviewing files that changed from the base of the PR and between 0676f40 and 37456d2.

📒 Files selected for processing (2)
  • src/fosslight_util/oss_item.py
  • tests/test_oss_item_copyright.py

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


📝 Walkthrough

Walkthrough

OssItem.copyright now removes duplicate entries while preserving the order of first occurrence for list and newline-separated inputs. Tests cover both input forms.

Changes

Copyright order

Layer / File(s) Summary
Copyright deduplication and tests
src/fosslight_util/oss_item.py, tests/test_oss_item_copyright.py
A helper retains the first occurrence of each item. The copyright property uses it for list and newline-separated inputs. Tests check order preservation and duplicate removal.

Priority: ⬇️ Low

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

Change: Bug fix

Suggested reviewers: dd-jy

Merge Risk: ⚪ Minimal · up to 37456

The change makes duplicate copyright normalization retain first-seen order, with tests covering string and list inputs. No concrete merge-blocking risk is identified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: preserving the order of copyright statements in OssItem.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

Soim Kim added 2 commits September 30, 2026 10:08
set() order follows PYTHONHASHSEED. Sorting the unique lines
keeps the report stable at the same cost as the set itself.
@soimkim soimkim self-assigned this Sep 30, 2026
@soimkim soimkim added the chore [PR/Issue] Refactoring, maintenance the code label Sep 30, 2026
@soimkim
soimkim merged commit e26cef9 into main Sep 30, 2026
7 of 8 checks passed
@soimkim
soimkim deleted the fix/copyright-order branch September 30, 2026 01:48
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.

1 participant