spotless icon indicating copy to clipboard operation
spotless copied to clipboard

Allow inserting custom date format in license header

Open caymaynard opened this issue 3 months ago • 0 comments

Similar to https://github.com/diffplug/spotless/issues/1147, I have a custom license header format which included the date when the file was created. This date is somewhat custom as well, it uses the format long_month day, year, e.g. November 14, 2025.

The IntelliJ plugin supports the format method for any date https://www.jetbrains.com/help/idea/copyright-profiles.html#profile_page

It would be great if Spotless also had a similar method to customize the format of the current time instead of only inserting the year.

The ideal format would be something like

Copyright (c) $NOW.format("MMMM dd, YYYY")

which would display as

Copyright (c) November 14, 2025

caymaynard avatar Nov 13 '25 22:11 caymaynard