pkgcore / pkgdev

collection of tools for Gentoo development
https://pkgcore.github.io/pkgdev/
BSD 3-Clause "New" or "Revised" License
30 stars 12 forks source link

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

Open thesamesam opened 1 year ago

thesamesam commented 1 year ago

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.

antecrescent commented 5 months ago

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.

thesamesam commented 5 months ago

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.