Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
- `FenceStep.preserveWithin` now forwards lints from nested steps while still suppressing lints inside preserved blocks. ([#2962](https://github.com/diffplug/spotless/pull/2962))
- Support `ktfmt` 0.63 and use its new builder API for formatting options to better avoid future breaking changes.
- Parse standard git year output in LicenseHeaderStep. ([#2940](https://github.com/diffplug/spotless/issues/2940))
- Fix `StringIndexOutOfBoundsException` in scenarios where copyright year is surrounded by whitespace. ([#2973](https://github.com/diffplug/spotless/pull/2973))

### Changes
- Bump default `greclipse` version to latest `4.35` -> `4.39`. ([#2924](https://github.com/diffplug/spotless/pull/2924))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ private String calculateYearBySearching(String content) {
String secondYear = null;
if (updateYearWithLatest) {
secondYear = firstYear.equals(yearToday) ? null : yearToday;
} else {
} else if (yearMatcher.end() + 1 < content.length()) {
String contentWithSecondYear = content.substring(yearMatcher.end() + 1);
int endOfLine = contentWithSecondYear.indexOf('\n');
if (endOfLine != -1) {
Expand Down
1 change: 1 addition & 0 deletions plugin-gradle/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
- `toggleOffOn` no longer disables lint-only steps such as `forbidWildcardImports`. ([#2962](https://github.com/diffplug/spotless/pull/2962))
- Prevent build caches from interfering when executing under the `-PspotlessIdeHook` mode. ([#2365](https://github.com/diffplug/spotless/issues/2365))
- Parse standard git year output in LicenseHeaderStep. ([#2940](https://github.com/diffplug/spotless/issues/2940))
- Fix `StringIndexOutOfBoundsException` in scenarios where copyright year is surrounded by whitespace. ([#2973](https://github.com/diffplug/spotless/pull/2973))

### Changes
- Bump default `greclipse` version to latest `4.35` -> `4.39`. ([#2924](https://github.com/diffplug/spotless/pull/2924))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2025 DiffPlug
* Copyright 2016-2026 DiffPlug
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -56,13 +56,32 @@ private void assertTransform(String yearBefore, String yearAfter) throws IOExcep
private void testSuiteUpdateWithLatest(boolean update) throws IOException {
if (update) {
assertTransform("2003", "2003-" + NOW);
assertTransform(" 2003", "2003-" + NOW);
assertTransform("2003 ", "2003-" + NOW);
assertTransform(" 2003 ", "2003-" + NOW);

assertTransform("2003-2005", "2003-" + NOW);
assertTransform(" 2003-2005", "2003-" + NOW);
assertTransform("2003-2005 ", "2003-" + NOW);
assertTransform(" 2003-2005 ", "2003-" + NOW);
} else {
assertUnchanged("2003");
assertTransform(" 2003", "2003");
assertTransform("2003 ", "2003");
assertTransform(" 2003 ", "2003");

assertUnchanged("2003-2005");
assertTransform(" 2003-2005", "2003-2005");
assertTransform("2003-2005 ", "2003-2005");
assertTransform(" 2003-2005 ", "2003-2005");
}
assertUnchanged(NOW);
assertTransform(" " + NOW, NOW);
assertTransform(NOW + " ", NOW);
assertTransform(" " + NOW + " ", NOW);

assertTransform("", NOW);
assertTransform(" ", NOW);
}

@Test
Expand Down
2 changes: 2 additions & 0 deletions plugin-maven/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
### Fixed
- Parse standard git year output in LicenseHeaderStep. ([#2940](https://github.com/diffplug/spotless/issues/2940))
- `<toggleOffOn>` no longer disables lint-only steps such as `<forbidWildcardImports>`. ([#2962](https://github.com/diffplug/spotless/pull/2962))
- Fix `StringIndexOutOfBoundsException` in scenarios where copyright year is surrounded by whitespace. ([#2973](https://github.com/diffplug/spotless/pull/2973))

### Added
- Add support for AsciiDoc formatting via `adocfmt`. ([#2960](https://github.com/diffplug/spotless/pull/2960))
- `<flexmark>` step now supports arbitrary formatter options via `<formatterOptions>`. ([#2968](https://github.com/diffplug/spotless/pull/2968))
Expand Down