Skip to content

Commit a49c2b1

Browse files
committed
Convert diktat integration to use a compile-only sourceset
* Pass absolute path into `Params` object to resolve the problem with package name checking * Update changelogs
1 parent ef85dc4 commit a49c2b1

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

CHANGES.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
1111

1212
## [Unreleased]
1313
### Changes
14-
* Bump default `diktat` version to latest `1.0.1` -> `1.0.1`.
14+
* Bump default `diktat` version to latest `1.0.1` -> `1.1.0`.
1515
* Converted `diktat` integration to use a compile-only source set. ([#524](https://github.com/diffplug/spotless/issues/524))
16+
* Use the full path to a file in `diktat` integration ([#1189](https://github.com/diffplug/spotless/issues/1189))
1617

1718
## [2.25.1] - 2022-04-27
1819
### Changes

lib/src/diktat/java/com/diffplug/spotless/glue/diktat/DiktatFormatterFunc.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ public String applyWithFile(String unix, File file) throws Exception {
6767
errors.clear();
6868
userData.put("file_path", file.getAbsolutePath());
6969
String result = KtLint.INSTANCE.format(new Params(
70-
file.getName(),
70+
// Unlike Ktlint, Diktat requires full path to the file.
71+
// See https://github.com/diffplug/spotless/issues/1189, https://github.com/analysis-dev/diktat/issues/1202
72+
file.getAbsolutePath(),
7173
unix,
7274
rulesets,
7375
userData,

plugin-gradle/CHANGES.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
44

55
## [Unreleased]
66
### Changes
7-
* Bump default `diktat` version to latest `1.0.1` -> `1.0.1`.
7+
* Bump default `diktat` version to latest `1.0.1` -> `1.1.0`.
88
* Converted `diktat` integration to use a compile-only source set. ([#524](https://github.com/diffplug/spotless/issues/524))
9+
* Use the full path to a file in `diktat` integration ([#1189](https://github.com/diffplug/spotless/issues/1189))
910

1011
## [6.5.1] - 2022-04-27
1112
### Changes

plugin-maven/CHANGES.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
44

55
## [Unreleased]
66
### Changes
7-
* Bump default `diktat` version to latest `1.0.1` -> `1.0.1`.
7+
* Bump default `diktat` version to latest `1.0.1` -> `1.1.0`.
88
* Converted `diktat` integration to use a compile-only source set. ([#524](https://github.com/diffplug/spotless/issues/524))
9+
* Use the full path to a file in `diktat` integration ([#1189](https://github.com/diffplug/spotless/issues/1189))
910

1011
## [2.22.3] - 2022-04-27
1112
### Changes

0 commit comments

Comments
 (0)