Skip to content

Fix copyright detection for text-classified files and restore fixtures(#2299) - #5264

Merged
AyanSinhaMahapatra merged 1 commit into
aboutcode-org:developfrom
BoLiuV5:boliuv5-add-copyright-test-cases-2299
Aug 28, 2026
Merged

Fix copyright detection for text-classified files and restore fixtures(#2299)#5264
AyanSinhaMahapatra merged 1 commit into
aboutcode-org:developfrom
BoLiuV5:boliuv5-add-copyright-test-cases-2299

Conversation

@BoLiuV5

@BoLiuV5 BoLiuV5 commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

This fixes a regression in numbered_text_lines() where valid text-bearing files were dropped when typecode reported contains_text == False, even though they were still text-classified and extractable.

The early return prevented cluecode from detecting copyright notices in files misidentified by libmagic. We now allow text-classified files through the normal extraction path instead of rejecting them prematurely.

This also restores corrupted ORT and junk-copyright fixture inputs that were causing false failures in the cluecode golden tests.

Fixes #2299

Tasks

  • Reviewed contribution guidelines
  • PR is descriptively titled and links the original issue above
  • Tests pass locally
  • Commits are in a uniquely named feature branch and have no merge conflicts

This fixes a regression in numbered_text_lines() where valid text-bearing files were dropped when typecode reported contains_text == False, even though they were still text-classified and extractable.

The early return prevented cluecode from detecting copyright notices in files misidentified by libmagic. We now allow text-classified files through the normal extraction path instead of rejecting them prematurely.

This also restores corrupted ORT and junk-copyright fixture inputs that were causing false failures in the cluecode golden tests.

Signed-off-by: Bo Liu <bo2018luo@gmail.com>
@BoLiuV5
BoLiuV5 force-pushed the boliuv5-add-copyright-test-cases-2299 branch from a3dbeb1 to 204292e Compare August 12, 2026 17:30
@BoLiuV5 BoLiuV5 changed the title Fix copyright detection for text-classified files and restore fixtures Fix copyright detection for text-classified files and restore fixtures(#2299) Aug 12, 2026

@AyanSinhaMahapatra AyanSinhaMahapatra left a comment

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.

Thanks @BoLiuV5 LGTM!

@AyanSinhaMahapatra
AyanSinhaMahapatra merged commit 2a3e4ef into aboutcode-org:develop Aug 28, 2026
37 checks passed
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.

Add new copyright test cases

2 participants