Skip to content

How to handle different sets of copyright holder lines? #101

Open

Description

@peterjc

How do you suggest handling different lists of copyright holders and/or dates in different files? For example, suppose the main LICENSE and template tries to capture the union of all contributors - an example based on that from #64:

 Copyright © 2023-2024 John Doe <john@example.com>
 Copyright © 2020-2022 Steve Luamo <steve@luamo.com>
 Copyright © 2015-2022 Leve Stuamo <leve@stuamo.com>

Some of the project files might match the above perfectly - the easy case. However, the project might have some new code files just by John:

 Copyright © 2023-2024 John Doe <john@example.com>

But there could be some static files which John has not edited which are only copyright by the original team, e.g.

 Copyright © 2015-2017 Leve Stuamo <leve@stuamo.com>

Leaving aside #64 on which lines if any need updating with --use-current-year, is there anyway to handle this gracefully in this hook?

Activity

  1. peterjc commented on Sep 2, 2024

    @peterjc
    Author

    I can think of a partial workaround based on excluding multiple copyright holder lines from the license block being checked - leaving none, or a single umbrella entry.

    For example, if all the contributors work for the same employer, that body is likely the actual copyright holder and you just have date-variants of Copyright © 2023-2024 The Company to worry about.

    This idea also works if you can name the contributors collectively from the point of view of the license header (perhaps supplemented by a list of names and dates above/below the automatically checked license block), e.g. Copyright © 2023-2024 The Project Contributors.

    If there are just a couple of named entities involved, you might be able to solve this with multiple license templates (e.g. one file with Copyright © 2015-2022 The Start-Up Company, one file with Copyright © 2023-2024 John Doe Sole-Trader, and one file with both). This won't scale though.

    If this use-case is common, perhaps we need some kind of <AUTHOR-LINE> or <COPYRIGHT-HOLDER> wildcard within the license block template?

  2. Lucas-C commented on Dec 5, 2025

    @Lucas-C
    Owner

    In the past I successfully defined several insert-license hooks in a .pre-commit-config.yaml file: maybe that could cover your use case?

  3. peterjc commented on Dec 5, 2025

    @peterjc
    Author

    Did you mean different hooks for different files, covering different pools of authors? Or just different template licenses with different pools of authors. That might work for small teams but doesn't scale.

    The only simple solution (if the project members agree) is a consistent copyright line in the license header, eg Copyright (c) 2020-2025, The Project XXX Contributors.

    On the project linked above we used a standardised 'corporate' copyright of Copyright (c) 2024-2025 University of Strathclyde but with the project funding over all recent and future changes will by default be copyright by a pool of authors, so perhaps we'll use Copyright (c) 2024-2025 University of Strathclyde and external contributors or similar in future.

    i.e. Social rather than technical solutions to the automated license check.

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions