pkgdev icon indicating copy to clipboard operation
pkgdev copied to clipboard

mangler: allow configuring copyright year behaviour (and possibly author) via editorconfig

Open thesamesam opened this issue 2 years ago • 2 comments

Right now, we only do copyright year updating in pkgdev commit for the Gentoo repository, but it can be useful in other repositories. We could make it configurable both for year and possibly the line ("Gentoo Authors" or something else).

See also https://github.com/pkgcore/pkgdev/issues/11. I'm not sure if this belongs in a metadata/ file or in .editorconfig. I think it might be a good fit for the latter.

See also https://github.com/pkgcore/pkgdev/issues/127.

thesamesam avatar Mar 24 '23 02:03 thesamesam

Right now, we only do copyright year updating in pkgdev commit for the Gentoo repository, but it can be useful in other repositories.

I agree. Also Gentoo Foundation -> Gentoo Authors updating should be available to other official Gentoo repositories as well. In particular, I'm thinking of GURU here, which generally does not get merged into ::gentoo and where contributors occasionally push ebuilds with Gentoo Foundation copyright notices.

See also https://github.com/pkgcore/pkgdev/issues/11. I'm not sure if this belongs in a metadata/ file or in .editorconfig.

I don't see how EditorConfig is the right tool for this. None of the supported k-v pairs allow specifying a copyright template.

antecrescent avatar Jun 12 '24 12:06 antecrescent

The spec has:

EditorConfig cores shall accept and report all syntactically valid key-value pairs, even if the key is not defined in this specification. EditorConfig plugins shall ignore unrecognized keys and invalid/unsupported values.

editorconfig k/vs can be extended although there's no extension namespace (so no prefix which is reserved for extensions).

It feels like a decent fit, but I don't insist on us using it.

thesamesam avatar Jun 12 '24 16:06 thesamesam