Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def validate_license_expression(
)

validation_messages = []
license_ref_ids: List[str] = [license_ref.license_id for license_ref in document.extracted_licensing_info]
license_ref_ids: List[str] = [license_ref.license_id.lower() for license_ref in document.extracted_licensing_info]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

going to .lower() feels wrong, as the upper case is the default for most licenses?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Should I take any other approach to make licenseIds case insensitive.(we have couple of other methods other than .lower())

Or keeping them case sensitive is just fine:(

Well, what are your thoughts?

@puneeth072003 puneeth072003 Jan 2, 2024

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Sorry, I'm new to licenses and stuff.

It would be great to have your opinion

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think uppercase would be more consistent


for non_spdx_token in spdx_licensing.validate(license_expression).invalid_symbols:
if ":" in non_spdx_token:
Expand Down Expand Up @@ -72,7 +72,7 @@ def validate_license_expression(
)
)

elif non_spdx_token not in license_ref_ids:
elif non_spdx_token.lower() not in license_ref_ids:
validation_messages.append(
ValidationMessage(
f"Unrecognized license reference: {non_spdx_token}. license_expression must only use IDs from the "
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.