Skip to content

Return warnings for duplicate and empty license aliases - #137

Open
codewithfourtix wants to merge 2 commits into
aboutcode-org:mainfrom
codewithfourtix:fix-alias-validation-warnings
Open

Return warnings for duplicate and empty license aliases#137
codewithfourtix wants to merge 2 commits into
aboutcode-org:mainfrom
codewithfourtix:fix-alias-validation-warnings

Conversation

@codewithfourtix

Copy link
Copy Markdown

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.

Signed-off-by: Ali Zulfiqar <codewithfourtix@gmail.com>
Copilot AI lite review requested due to automatic review settings September 5, 2026 17:02
Signed-off-by: Ali Zulfiqar <codewithfourtix@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 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 warnings list (keyed by license key), instead of incorrectly iterating the conflicting-alias collection and appending to errors.
  • 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants