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

Make FS smart about the year in generated license headers #4

Open
sdboyer opened this issue Oct 20, 2022 · 0 comments
Open

Make FS smart about the year in generated license headers #4

sdboyer opened this issue Oct 20, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@sdboyer
Copy link
Contributor

sdboyer commented Oct 20, 2022

As it is currently written, codejen.FS treats all bytes as undifferentiated. This is fine, for now. But when the year rolls over, lines like this, will be updated.

This isn't usually the way that license headers work - typically the year is left alone, once the file is created.

While i do want to avoid putting too much smarts into the codejen.FS, i'd be comfortable with a hack that sniffs specifically for a regex pattern like that in a file that it's writing to or verifying, and dynamically changing the bytes in its buffer to be the year that's in the file already on disk.

@sdboyer sdboyer transferred this issue from grafana/grafana Nov 9, 2022
@sdboyer sdboyer added the enhancement New feature or request label Nov 9, 2022
@sdboyer sdboyer changed the title Make codegen.WriteDiffer smart about the year in generated license headers Make FS smart about the year in generated license headers Dec 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant