Skip to content

Copyright start year defaults to the year of the run instead of the file's @Date year #85

Closed

Description

@Shinrai

Problem

@Copyright: Copyright (c) <start>-<end> <company> All rights reserved. takes <start> from copyrightStartYear, else the current year of the run — the same for every file (src/detect/project.mjs: copyrightStartYear: … : currentYear). A file created in 2019 gets 2026-2026 when fix-headers first runs in 2026.

Expected

  • copyrightStartYear set → that year (unchanged).
  • Not set → the year of the file's @Date (the resolved creation date: the existing header value, or oldest-wins from git / filesystem for a new header, after fixCreatedDate if enabled), in the time zone the date is written in (timezone if set, else the date's own offset).
  • <end> stays the current year of the run (expected: the latest year the file changed).

Tests

Existing header with a 2019 @Date → 2019-<current>; new header from a git first commit in a past year; copyrightStartYear still wins; a @Date near New Year where the year depends on the offset / timezone; fixCreatedDate moving @Date into an earlier year moves the start year with it.

Activity

  1. added
    type: bug
    priority: medium
    area: core
    status: in progress
    on Sep 29, 2026
  2. added 2 commits that reference this issue on Sep 29, 2026
    433de4b
    ac8bfc1
  3. added
    status: implemented
    and removed
    status: in progress
    on Sep 29, 2026
  4. cldmv-bot commented on Sep 29, 2026

    @cldmv-bot
    Contributor

    Marked status: implemented — resolved by #89, merged into next. This issue closes automatically when that work ships to the default branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: corepriority: mediumstatus: implementedtype: bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions