Skip to content

Fix copyright cut off after name, company and obfuscated email - #5575

Open
iLakshya04 wants to merge 1 commit into
aboutcode-org:developfrom
iLakshya04:fix/5574-copyright-name-company-obfuscated-email
Open

iLakshya04 wants to merge 1 commit into
aboutcode-org:developfrom
iLakshya04:fix/5574-copyright-name-company-obfuscated-email

Conversation

@iLakshya04

Copy link
Copy Markdown

Fixes #5574

Problem

For Copyright (c) 2004, Mikael Grev, MiG InfoCom AB. (miglayout (at) miginfocom (dot) com), ScanCode returned the copyright Copyright (c) 2004, Mikael Grev and the holder Mikael Grev. The company was cut off.

Cause

  • The lexer rule [A-Z][a-z][A-Z]$ -> JUNK (meant for junk like ZoY) also matched MiG. That broke the name, company chain.
  • Once that was fixed, the holder also picked up the obfuscated email, because (at) and (dot) in parens were not lexed like the existing at and dot.

Change

  • Remove the three-letter mixed-case JUNK rule.
  • Lex (at) as CC and (dot) as DOT, so the existing foo at bar dot com email rule applies.
  • Add a data-driven test (miglayout_mig_infocom.txt) and a CHANGELOG entry.

Holder is now Mikael Grev, MiG InfoCom AB.. The copyright still includes the parenthesized email, as it does for other holders followed by an email. The issue's expected copyright stops before the email, so tell me if you want that changed.

Testing

  • New test fails before the change and passes after.
  • tests/cluecode with --test-suite=all: 5143 passed. The same 35 tests fail with and without my change.
  • Caveat: libmagic is not installed on my machine, so I ran with typecode stubbed. I believe the 35 failures are from that: 10 plugin tests fail with import errors, and the other 25 (html, mp4, pixelstream and similar) I assumed are file-type related but did not check one by one. Please rely on CI for the full result.
  • Risk: removing the JUNK rule changed no existing test result, but I cannot rule out effects on other inputs.

Commit is signed off (DCO).

A three-letter mixed-case word such as MiG was lexed as JUNK, which broke
the name, company chain so the copyright and holder stopped at the name.
Remove that rule, and lex parenthesized (at) and (dot) like at and dot
so the obfuscated email is recognised and left out of the holder.

Reference: aboutcode-org#5574
Signed-off-by: Lakshya <152306273+iLakshya04@users.noreply.github.com>
@iLakshya04
iLakshya04 force-pushed the fix/5574-copyright-name-company-obfuscated-email branch from 9591cfa to e225a52 Compare December 2, 2026 05:07

This branch has not been deployed

No deployments
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.

ScanCode cuts off the copyright statement when the holder list has a person's name followed by a company name, separated by a comma.

1 participant