Return warnings for duplicate and empty license aliases - #137
Open
codewithfourtix wants to merge 2 commits into
Open
Return warnings for duplicate and empty license aliases#137codewithfourtix wants to merge 2 commits into
codewithfourtix wants to merge 2 commits into
Conversation
Signed-off-by: Ali Zulfiqar <codewithfourtix@gmail.com>
Signed-off-by: Ali Zulfiqar <codewithfourtix@gmail.com>
There was a problem hiding this comment.
🟢 Approval recommended
The change directly corrects the warning/error return logic and is backed by targeted tests that verify the intended behaviors.
Pull request overview
Fixes validate_symbols() so duplicate/empty alias findings are returned as warnings (under the correct license keys) rather than being mistakenly appended as errors, and adds regression tests to cover both warning and conflicting-alias error behavior.
Changes:
- Return collected duplicate/empty alias messages in the
warningslist (keyed by license key), instead of incorrectly iterating the conflicting-alias collection and appending toerrors. - Add tests covering (a) duplicate/empty alias warnings and (b) conflicting alias reuse across different license keys remaining an error.
File summaries
| File | Description |
|---|---|
src/license_expression/__init__.py |
Corrects warning vs. error aggregation/return behavior in validate_symbols(). |
tests/test_license_expression.py |
Adds regression tests for duplicate/empty alias warnings and conflicting-alias errors. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
validate_symbols()collects duplicate and empty alias warnings but reads the conflicting-alias collection when returning them, appending to errors instead. Return the collected warnings under their license keys.Adds tests for duplicate and empty aliases, and checks that aliases shared by different licenses remain errors.