Skip to content

Fix standalone year-only copyright detection without holder#4756

Open
dikshaa2909 wants to merge 1 commit intoaboutcode-org:developfrom
dikshaa2909:fix-d3-copyright-author-detection
Open

Fix standalone year-only copyright detection without holder#4756
dikshaa2909 wants to merge 1 commit intoaboutcode-org:developfrom
dikshaa2909:fix-d3-copyright-author-detection

Conversation

@dikshaa2909
Copy link

Fixes #4755

Summary

This PR fixes incorrect handling of standalone year-only copyright
detections during parse tree traversal.

Previously:

  • Standalone year-only copyright statements (e.g., Copyright 2010)
    could pass through without proper holder validation.
  • Author detections were yielded outside their intended conditional scope
    due to indentation and control-flow issues.

This caused inconsistent behavior in certain scan outputs.


Changes Implemented

  • Cleaned up parse tree traversal logic.
  • Properly scoped yield author inside its include_authors condition.
  • Ensured standalone year-only copyright detections are skipped when no holder is present.
  • Maintained existing behavior for valid copyright + holder detections.
  • No impact on unrelated components.

Validation

  • Full test suite executed locally.
  • Failure count remains consistent with baseline (no new regressions introduced).
  • Manual validation performed using d3 sample scan.
  • Verified:
    • CHANGES.md does not produce unintended detections.
    • LICENSE detection remains correct.
    • No additional false positives introduced.

Tasks

  • Reviewed contribution guidelines
  • PR is descriptively titled and links the original issue above
  • Tests pass locally (no new failures introduced)
  • Commits are in uniquely-named feature branch and has no merge conflicts
  • Updated documentation pages (not applicable)
  • Updated CHANGELOG.rst (not applicable)

Signed-off-by: Diksha Deware dikshadeware@gmail.com

Signed-off-by: dikshaa2909 <dikshadeware@gmail.com>
@dikshaa2909 dikshaa2909 force-pushed the fix-d3-copyright-author-detection branch from dfdfb91 to bfa8e9a Compare February 17, 2026 14:30
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.

Truncated copyright, missing holder, and false positive author in d3 scan

1 participant

Comments