Allow inserting custom date format in license header
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 42/100
Research direction
No implementation files or tests are named. Start by locating the existing Spotless license-header handling for the year or $NOW token, then trace how header values are tested. Done means supporting a date format such as $NOW.format("MMMM dd, YYYY") and producing the requested formatted date in the generated header.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- Java
- Stars
- 5.7k
- Forks
- 560
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 43
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from diffplug/spotless
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 66/100
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
All issues in diffplug/spotless
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100