-
Notifications
You must be signed in to change notification settings - Fork 460
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
License header forces same year for all source files #183
Comments
Hi @chrisbanes. I'm not sure if I've understood you correctly. Am I correct in thinking that you're saying that your IDE updates copyright headers to 2018, as you expected, and that Spotless updates copyright headers to 2018 as well once you change the file pointed to by |
Kind of. My IDE generates new source files with a copyright header of 2018, which I expect. Existing files are kept the same (2017, etc). I don't see a way to support that with Spotless (but maybe I'm wrong). |
Okay, I think I understand better what you're after now. Regarding common embed tags for year, author, etc., there is coincidentally an open PR to introduce an embed-tag feature for years specifically. By my understanding, it would allow embedding an optional "$YEAR" tag into the template header pointed to by However, I suspect that that's not exactly what you're after, since this PR would only support updating all copyright headers throughout a codebase with the current year, instead of just putting the current year into the copyright headers of new files. I admit that it's not clear to me personally if or how we could support a feature like this. @nedtwigg @baptistemesta do you have any thoughts on this? |
Aha! I missed that PR. It actually looks @baptistemesta had the same idea and combined A & B above. Feel free to close this. |
Cool, I'll close this issue then. Feel free to re-open if more needs to be discussed. :) |
@baptistemesta's PR has been merged and released in |
We now support changing the year only for changed files (also a big performance improvement) using our new |
My IDE correctly auto generated a new copyright header with the year 2018, whereas my spotless license header still has 2017. If I change my spotless file to 2018, all other source files have 2018 applied which isn't what I want.
Any ideas? This might be working as intended, but it would be nice if either:
a) Spotless exposes common embed tags similar to IntelliJ (year, author, etc)
b) We can embed regex (for check) with a default value (for apply) in the header. Maybe something like:
Copyright blah $([0-9]{4}, 2018)
The text was updated successfully, but these errors were encountered: