reuse-tool icon indicating copy to clipboard operation
reuse-tool copied to clipboard

Add flag `--replace` to `annotate`

Open carmenbianca opened this issue 2 years ago • 4 comments

Example foo.py:

# Copyright (c) Wrong Information Here
# Rest of the header

print("Hello, world!")

Following e.g. reuse annotate --replace --copyright Carmen foo.py:

# SPDX-FileCopyrightText: 2023 Carmen

print("Hello, world!")

Mutually exclusive with --no-replace.

Probably also exclusive with --merge-copyrights.

carmenbianca avatar Jun 28 '23 12:06 carmenbianca

Then one case would be missing: Replace the line # Copyright (c) Wrong Information Here but keep the line # Rest of the header ;)

mxmehl avatar Jun 29 '23 20:06 mxmehl

I think that's a separate issue. It'd be nice if we could split comments like this:

# Copyright 2023 Jane Doe
#
# This module puts the foo in foobar, inspired by baz, bla bla bla bla bla.

And then when you run reuse annotate --split-first-comment --license MIT, you get something like:

# Copyright 2023 Jane Doe
#
# SPDX-License-Identifier: MIT

# This module puts the foo in foobar, inspired by baz, bla bla bla bla bla.

carmenbianca avatar Jun 29 '23 21:06 carmenbianca