Skip to content

Fix author detection for compact dotted names (#4229) - #5308

Open
Hrithikcrick wants to merge 2 commits into
aboutcode-org:developfrom
Hrithikcrick:fix-author-detection-4229
Open

Fix author detection for compact dotted names (#4229)#5308
Hrithikcrick wants to merge 2 commits into
aboutcode-org:developfrom
Hrithikcrick:fix-author-detection-4229

Conversation

@Hrithikcrick

@Hrithikcrick Hrithikcrick commented Sep 11, 2026

Copy link
Copy Markdown

Fixes #4229

Summary

Fixes author detection for compact dotted author declarations such as:

Author:Frankie.Chu

The implementation is intentionally scoped to author-tag context so unrelated dotted tokens are not globally classified as names.

Changes

  • Normalize compact Author: declarations before tokenization.
  • Handle dotted names only when they follow an Author tag.
  • Avoid the broader global dotted-name lexer rule that caused unrelated license-validation regressions.
  • Add regression coverage for the exact case reported in Author not detected in C++ file #4229.

Testing

  • Targeted author regression test: passed.
  • Basic copyright detection tests: passed.
  • Previously failing license-validation shards: 14,989 passed.
  • Full hosted Azure pipeline: passed with 0 errors.
  • ReadTheDocs: passed.
  • git diff --check: clean.

Files changed

  • src/cluecode/copyrights.py
  • tests/cluecode/test_copyrights_basic.py

Signed-off-by: Hrithik Sharma <sharmahrithik2806@gmail.com>
Signed-off-by: Hrithik Sharma <sharmahrithik2806@gmail.com>
@Hrithikcrick

Copy link
Copy Markdown
Author

Updated after CI validation: the broad dotted-name lexer behavior was removed and the handling is now scoped to Author context.

The previously failing license-validation shards pass locally, the full Azure build now succeeds with 0 errors, and ReadTheDocs is green.

The remaining GitHub Actions workflows are awaiting maintainer approval.

Ready for review. Thanks!

@Shriprasad-P Shriprasad-P 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.

Review

PR: Fix author detection for compact dotted names (#4229)

Touched: src/cluecode/copyrights.py, tests/cluecode/test_copyrights_basic.py

  • Addresses a concrete correctness/reliability issue based on the title and diff.
  • Includes or touches tests — good for locking the behavior.
  • Security-sensitive change — please double-check edge cases and defaults.
  • Size looks manageable (+32/-0).

Commenting as a drive-by reviewer after reading the diff. Happy to look again if maintainers want a deeper pass on a specific file.

@Hrithikcrick

Copy link
Copy Markdown
Author

Thanks a lot for taking the time to review this PR and for the helpful feedback!

I've tried to keep the change narrowly scoped and added tests to cover the intended compact dotted-name behavior while preserving the existing behavior.

I also appreciate the note about this being security-sensitive. I'll double-check the edge cases and defaults carefully to make sure the change doesn't introduce regressions in author detection.

If you noticed any specific edge case or scenario that you think should be covered additionally, I'd be happy to add a regression test for it.

Thanks again for the review!

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.

Author not detected in C++ file

2 participants