Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to specify previous maintainer in the updated copyright? #79

Open
chshersh opened this issue Oct 3, 2021 · 4 comments
Open

How to specify previous maintainer in the updated copyright? #79

chshersh opened this issue Oct 3, 2021 · 4 comments
Assignees
Labels
feature New feature or request

Comments

@chshersh
Copy link

chshersh commented Oct 3, 2021

We moved our co-log-related packages to a separate organization. So I would like to update maintainership with headroom automatically to something like that:

Copyright : (c) 2018-2020 Kowainik, 2021 Co-Log

However, what I currently see is the following:

Do you know if there's a way to update the copyright in the desired way?

Corresponding PR:

I'm using the following headroom version:

$ headroom --version
headroom, v0.4.2.0 :: https://github.com/vaclavsvejcar/headroom
@vaclavsvejcar
Copy link
Owner

Hi @chshersh,

so if I got it right, you need to combine the existing Copyright field value detected from source code (if exists) and the new one from .headroom.yaml variables, right? Not sure if there's easy way to do at this moment, maybe using some conditions in Mustache template, but I'll need to check Headroom's code briefly and will get back to you asap with more details.

@chshersh
Copy link
Author

chshersh commented Oct 4, 2021

Hi @vaclavsvejcar,

Yes, you understood my question correctly 👍🏻

I'm thinking that maybe headroom can give access to the previous copyright so in my .headroom.yaml I can write something like this:

_haskell_module_copyright: "(c) {{_previous_copyright}}, {{ _current_year }} {{ author }}"

@vaclavsvejcar
Copy link
Owner

Hi @chshersh,

sorry for late reply, I was really busy at work. I think at this moment there's no way how to achieve this in current Headroom, now it only allows you to use the existing Copyright field extracted from the source code file, or new one defined either in template file or the default one in _haskell_module_copyright dynamic template variable. I think it would be cool feature to have, however, at this moment, I'm not exactly sure how to achieve that in some nice, straightforward and non-hacky generic way. It would be probably necessary to add some smart logic that can compare the headers. I'll also try out the approach you proposed and I'll be happy if you have any other ideas how this could be done. Sorry if this blocks you from using Headroom on this particular use case.

@chshersh
Copy link
Author

chshersh commented Oct 7, 2021

Hi @vaclavsvejcar,

No need to apologise! OSS can be very demanding 😞 Headroom is already improving my workflow by a great deal!

I realized that my suggested solution doesn't really work. I'm afraid that the `{{_previous_copyright}}`` might lead to infinite recursion when applied carelessly. Also, if it's empty (e.g. for new files) then there will this annoying comma after the empty text. Maybe a better solution would be to use list templating capabilities in Mustache or and have something like

{{#authors}}{{.}} {{/authors}}

(maybe also with a combination of some special variable _has_multiple_authors). But smart logic on the headroom side is still required here.

For now, I can just run headroom and edit files manually. It's not a blocker 👍🏻
Thanks for your work on headroom so far! 🔝

@vaclavsvejcar vaclavsvejcar added the feature New feature or request label Oct 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants