grafana / grafana/codejen

Make `FS` smart about the year in generated license headers

Open
#4 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
10
Forks
1
PR merge metrics
No merged PRs in 30d

Description

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](https://github.com/grafana/grafana/blob/main/public/app/plugins/panel/barchart/models.cue#L1), 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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.