fsfe / reuse-tool

reuse is a tool for compliance with the REUSE recommendations.
https://reuse.software
399 stars 148 forks source link

No longer make copyright lines stringly typed #947

Open carmenbianca opened 6 months ago

carmenbianca commented 6 months ago

Presently, copyright lines are stringly typed in the tool. The whole thing SPDX-FileCopyrightText: 2016, 2018--2020, 2023--present Carmen Bianca BAKKER <carmenbianca@fsfe.org> is one string.

I think it might make sense to write some kind of CopyrightLine class that can parse elements from such strings. For example, the above properties of the above example:

If implemented well, this could heavily simplify date-range merging, which is currently spaghetti code.

silverhook commented 4 months ago

I like this.

Two changes I’d like to propose though:

carmenbianca commented 4 months ago

@silverhook all fields (except name) will be optional :)

for the formats, see the annotate documentation on what will be supported at the very least:

    spdx:           SPDX-FileCopyrightText: <year> <statement>
    spdx-c:         SPDX-FileCopyrightText: (C) <year> <statement>
    spdx-symbol:    SPDX-FileCopyrightText: © <year> <statement>
    string:         Copyright <year> <statement>
    string-c:       Copyright (C) <year> <statement>
    string-symbol:  Copyright © <year> <statement>
    symbol:         © <year> <statement>
silverhook commented 4 months ago

Personally I’d limit it down to:

    spdx-symbol:    SPDX-FileCopyrightText: © <year> <statement>
    spdx-c:         SPDX-FileCopyrightText: (c) <year> <statement>
    spdx-C:         SPDX-FileCopyrightText: (C) <year> <statement>

Maaaybeee include:

    spdx:           SPDX-FileCopyrightText: <year> <statement>

…but you know my thoughts on this ;)