Skip to content

Conversation

@arshad-muhammad
Copy link

Normalize Copyright Symbols in License Detection

What does this PR do?

This PR normalizes copyright symbols from [C] to (C) in the license detection logic.
Why is this change necessary?

The current detection logic fails to recognize [C] as a valid copyright sign, leading to false negatives in copyright detection.
How was this change implemented?

A new function, normalize_copyright_symbols, was added to the copyrights.py file, which replaces [C] with (C) and handles variations of the copyright statement.
What are the benefits of this change?

This change improves the accuracy of copyright detection, ensuring that more licenses are correctly identified.
Are there any breaking changes?

No breaking changes are introduced in this PR.
Testing and Validation:

Unit tests were updated to include cases with both [C] and (C) symbols to ensure they are correctly processed.
Additional Notes:

Related issue: #3929 (Improve Copyright Detection)

@pombredanne
Copy link
Member

Thanks, but did you study how copyright detection works and what is the flow of the code?
You should do this first to find where you want to make the changes.

@arshad-muhammad
Copy link
Author

Hi @pombredanne

Thank you for your response and guidance.

I’ll definitely take the time to study how copyright detection works and review the flow of the existing code to better understand the areas where changes should be made. I will explore the architecture to ensure I’m familiar with the process and how the buildpack.toml manifest could integrate into the system.

Once I have a clearer understanding, I’ll outline my approach and reach out for further input if needed.

Thanks again for pointing me in the right direction!

@pombredanne
Copy link
Member

Great. I am closing this until we have a better, integrated approach then.

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