Skip to content

Commit c519798

Browse files
1.7.0 prep (#3057)
* Fix indent level in documentation * Update release testing procedure * Prepare release 1.7.0 * Revert signing of the self-executable ktlint file Temporarily revert the Gradle configuration cache to unblock the release
1 parent 857ffbc commit c519798

File tree

5 files changed

+101
-14
lines changed

5 files changed

+101
-14
lines changed

CHANGELOG.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,92 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](https://semver.org/).
44

5+
## [1.7.0] - 2025-07-14
6+
7+
### 🆕 Features
8+
9+
#### Context receiver / parameters
10+
11+
With upgrade to Kotlin 2.2.0, Ktlint 1.7.0 supports context parameters.
12+
13+
* Add `context-receiver-list-wrapping` rule - [#3034](https://github.com/pinterest/ktlint/pull/3034), by @paul-dingemans
14+
15+
* Add context receiver list to `modifier-order` rule - [#3031](https://github.com/pinterest/ktlint/pull/3031), by @paul-dingemans
16+
17+
* Ignore context parameters in rule `context-receiver-wrapping` - [#3033](https://github.com/pinterest/ktlint/pull/3033), by @paul-dingemans
18+
19+
#### Other rule changes
20+
21+
* Do not run `no-unused-imports` rule by default - [#3039](https://github.com/pinterest/ktlint/pull/3039), by @paul-dingemans
22+
The `no-unused-import` rule is no longer run by default as it keeps causing problems. It will be removed in Ktlint `2.0`. Until then, the rule can still be run, when enabled explicitly in `.editorconfig`.
23+
24+
* Add experimental rule `expression-operand-wrapping` - [#3056](https://github.com/pinterest/ktlint/pull/3056), by @paul-dingemans
25+
This rule aligns wrapping of arithmetic and logical multiline expressions. The `condition-wrapping` rule which did something similar for logical multiline expressions only no longer reports and fixes violations. It will be removed in Ktlint `2.0`.
26+
27+
#### Other features
28+
29+
* Deprecate functions in `ASTNodeExtensions`, and where applicable provide property accessors - [#3026](https://github.com/pinterest/ktlint/pull/3026), by @paul-dingemans
30+
When using `ASTNodeExtensions` please replace function calls with the new (temporary) property accessors. The temporary property accessors are needed to maintain backwards compatability with Java integration. In Ktlint `2.0` the functions will be removed, and the temporary property accessors will be replaced with final names.
31+
32+
* Suppress warning "sun.misc.Unsafe::objectFieldOffset" in Ktlint CLI (Java24+) - [#3040](https://github.com/pinterest/ktlint/pull/3040), by @paul-dingemans
33+
34+
* Suppress error "A restricted method in java.lang.System has been called" on Java 24 in KtLint CLI only - [#3043](https://github.com/pinterest/ktlint/pull/3043), by @paul-dingemans
35+
36+
* Remove unneeded "--add-opens=java.base/java.lang=ALL-UNNAMED" - [#3044](https://github.com/pinterest/ktlint/pull/3044), by @paul-dingemans
37+
38+
39+
### 🔧 Fixes
40+
41+
42+
* Do not remove an empty value parameter list from a call expression when it is nested - [#3017](https://github.com/pinterest/ktlint/pull/3017), by @paul-dingemans
43+
44+
* Clarify violation message in `filename` rule - [#3046](https://github.com/pinterest/ktlint/pull/3046), by @paul-dingemans
45+
46+
### 📦 Dependencies
47+
48+
49+
* chore(deps): update plugin org.gradle.toolchains.foojay-resolver-convention to v1 - [#2989](https://github.com/pinterest/ktlint/pull/2989), by @renovate[bot]
50+
51+
* chore(deps): update plugin com.gradle.develocity to v4.0.2 - [#2996](https://github.com/pinterest/ktlint/pull/2996), by @renovate[bot]
52+
53+
* fix(deps): update junit5 monorepo - [#3005](https://github.com/pinterest/ktlint/pull/3005), by @renovate[bot]
54+
55+
* fix(deps): update dependency org.jetbrains.kotlin:kotlin-gradle-plugin to v2.2.0-rc3 - [#3015](https://github.com/pinterest/ktlint/pull/3015), by @renovate[bot]
56+
57+
* fix(deps): update dependency org.junit.jupiter:junit-jupiter to v5.13.2 - [#3020](https://github.com/pinterest/ktlint/pull/3020), by @renovate[bot]
58+
59+
* fix(deps): update dependency org.junit.platform:junit-platform-launcher to v1.13.2 - [#3021](https://github.com/pinterest/ktlint/pull/3021), by @renovate[bot]
60+
61+
* fix(deps): update kotlin monorepo to v2.2.0 - [#3018](https://github.com/pinterest/ktlint/pull/3018), by @renovate[bot]
62+
63+
* chore(deps): update plugin shadow to v8.3.8 - [#3030](https://github.com/pinterest/ktlint/pull/3030), by @renovate[bot]
64+
65+
* fix(deps): update junit-framework monorepo - [#3037](https://github.com/pinterest/ktlint/pull/3037), by @renovate[bot]
66+
67+
* chore(deps): update plugin kotlinx-binary-compatibiltiy-validator to v0.18.1 - [#3050](https://github.com/pinterest/ktlint/pull/3050), by @renovate[bot]
68+
69+
* fix(deps): update dependency dev.drewhamilton.poko:poko-gradle-plugin to v0.19.1 - [#3053](https://github.com/pinterest/ktlint/pull/3053), by @renovate[bot]
70+
71+
* fix(deps): update dependency com.google.jimfs:jimfs to v1.3.1 - [#3054](https://github.com/pinterest/ktlint/pull/3054), by @renovate[bot]
72+
73+
* chore(deps): update dependency gradle to v9.0.0-rc-2 - [#3055](https://github.com/pinterest/ktlint/pull/3055), by @renovate[bot]
74+
75+
### 💬 Other
76+
77+
* Update publishing URLs to point to Central Portal OSSRH staging API - [#3006](https://github.com/pinterest/ktlint/pull/3006), by @shashachu
78+
79+
* Update publishing credentials to use new Central Portal username/token - [#3007](https://github.com/pinterest/ktlint/pull/3007), by @shashachu
80+
81+
* Improve build - [#3025](https://github.com/pinterest/ktlint/pull/3025), by @mateuszkwiecinski
82+
83+
* Bump `poko-gradle-plugin` with a workaround (enforce compatible Kotlin version) - [#3035](https://github.com/pinterest/ktlint/pull/3035), by @mateuszkwiecinski
84+
85+
* Java 24 - [#3049](https://github.com/pinterest/ktlint/pull/3049), by @paul-dingemans
86+
87+
* Make `build-logic` plugins expose binary plugins - [#3047](https://github.com/pinterest/ktlint/pull/3047), by @mateuszkwiecinski
88+
89+
* Cleanup Java 24 bump - [#3051](https://github.com/pinterest/ktlint/pull/3051), by @mateuszkwiecinski
90+
591
## [1.6.0] - 2025-05-19
692

793
🆕 Features
@@ -2716,6 +2802,7 @@ set in `[*{kt,kts}]` section).
27162802

27172803
## 0.1.0 - 2016-07-27
27182804

2805+
[1.7.0]: https://github.com/pinterest/ktlint/compare/1.7.0...1.6.0
27192806
[1.6.0]: https://github.com/pinterest/ktlint/compare/1.6.0...1.5.0
27202807
[1.5.0]: https://github.com/pinterest/ktlint/compare/1.5.0...1.4.1
27212808
[1.4.1]: https://github.com/pinterest/ktlint/compare/1.4.1...1.4.0

RELEASE_TESTING.MD

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Before releasing a new version of KtLint, the release candidate is tested on a s
4040
```
4141
4. Create an alias or script to run the latest released version of ktlint (note that this script will print the version as reference to which version is used):
4242
```shell
43-
alias ktlint-prev="ktlint-1.3.1 $@" # Replace with the latest release version
43+
alias ktlint-prev="ktlint-1.6.0 $@" # Replace with the latest release version
4444
```
4545
Note that `~/git/ktlint` is the directory in which the ktlint project is checked out and that `~/git/ktlint/ktlint` refers to the `ktlint` CLI-module.
4646
5. Create an alias or script to run the latest development-version of ktlint (note that this script will print the version and the datetime of compilation as reference to which version is used):
@@ -99,7 +99,7 @@ Formatting projects in which ktlint is not used may result in a huge amount of f
9999
```shell
100100
./exec-in-each-project.sh "git add --all && git commit -m \"Update .editorconfig to fallback to integration test settings\""
101101
```
102-
3. Format with previous (*latest released*) version of Lint
102+
3. Format with previous (*latest released*) version of KtLint
103103
```shell
104104
ktlint-prev --format --relative # Do not call this command via the "./exec-in-each-project.sh" script.
105105
```
@@ -108,13 +108,13 @@ Formatting projects in which ktlint is not used may result in a huge amount of f
108108
```shell
109109
./exec-in-each-project.sh "git add --all && git commit -m \"Format with previous ktlint version (round #)\""
110110
```
111-
Repeat step 4 and 5 until no files are changed anymore. Although ktlint reruns up to 3 times in case new violations are introduced, it can still happen that not all violations have been fixed with a single invocation.
111+
Repeat step 3 and 4 until no files are changed anymore. Although ktlint reruns up to 3 times in case new violations are introduced, it can still happen that not all violations have been fixed with a single invocation.
112112
5. Build baseline file with previous (*latest released*) version of Lint (when building with format the offsets of the error are not saved correctly in the baseline) so that all errors which cannot be autocorrected are ignored.
113113
```shell
114114
rm baseline.xml
115115
ktlint-prev --baseline=baseline.xml --relative # Do not call this command via the "./exec-in-each-project.sh" script.
116116
```
117-
Note: Ignore all output as this is the old version! Inspect the baseline roughly to verify that it only contains errors that cannot be autocorrected.
117+
Note: Ignore all output as this is the old version! Inspect the baseline roughly to verify that it only contains errors that cannot be autocorrected.
118118
6. Format the sample projects with the previous (*latest released*) ktlint version:
119119
```shell
120120
ktlint-prev -F --baseline=baseline.xml --relative # Do not call this command via the "./exec-in-each-project.sh" script.
@@ -147,8 +147,8 @@ Formatting projects in which ktlint is not used may result in a huge amount of f
147147
* Usually it helps to disable all rules that emit violations, except one of those rules. In this way it is possible to evaluate the changes rule by rule.
148148
* Ideally, no violations are shown. This means that all violations have been autocorrected. Note that violations might pop up that previously were suppressed via the baseline. This can happen as due to code changes, the references in the baseline.xml no longer match with the positions where they occur. First check the code changes, and regenerating the baseline before verifying the next can be a helpful approach.
149149
* Violations which could not be autocorrected should be validated for correctness but do not block the release as most likely this is intended behavior.
150-
* If a violation is shown which is not marked as being "can not be autocorrected" this means that during autocorrect of another violation a new violations has been introduced. This should be fixed before releasing especially when the next format introduces the original violation again which of course would result in an endless loop.
151-
10. Inspect all fixed violations, Of course inspection similar violations tens of times does not make sense. At least check different types of violations a couple of times. Commit changes which do not need to be inspected again:
150+
* If a violation is shown which is not marked as being "cannot be autocorrected" this means that during autocorrect of another violation a new violations has been introduced. This should be fixed before releasing especially when the next format introduces the original violation again which of course would result in an endless loop.
151+
10. Inspect all fixed violations. Of course, inspection similar violations tens of times does not make sense. At least check different types of violations a couple of times. Commit changes which do not need to be inspected again:
152152
```shell
153153
./exec-in-each-project.sh "git add --all && git commit -m \"Fixed with latest development version\""
154154
```

documentation/snapshot/docs/rules/experimental.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ Suppress or disable rule (1)
125125
ktlint_standard_blank-line-between-when-conditions = disabled
126126
```
127127

128-
### Expression operand wrapping
128+
## Expression operand wrapping
129129

130130
Wraps each operand in a multiline expression to a separate line.
131131

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION_NAME=1.6.1-SNAPSHOT
1+
VERSION_NAME=1.7.0
22
POM_GROUP_ID=com.pinterest.ktlint
33

44
POM_DESCRIPTION=An anti-bikeshedding Kotlin linter with built-in formatter.
@@ -20,7 +20,7 @@ POM_DEVELOPER_NAME=Pinterest, Inc.
2020
org.gradle.jvmargs=-Xmx4g
2121
org.gradle.parallel=true
2222
org.gradle.caching=true
23-
org.gradle.configuration-cache=true
23+
org.gradle.configuration-cache=false
2424
org.gradle.configuration-cache.parallel=true
2525

2626
# Use V2 of the Dokka library and silence its warnings

ktlint-cli/build.gradle.kts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,6 @@ val shadowJarExecutable by tasks.registering(DefaultTask::class) {
7474
outputs.files(selfExecutableKtlintSignatureOutputPath)
7575
outputs.files(windowsBatchFileOutputPath)
7676

77-
if (signing.isRequired) {
78-
logger.lifecycle("Creating the signature file: $selfExecutableKtlintSignatureOutputPath")
79-
signing.sign(selfExecutableKtlintSignatureOutputPath)
80-
}
81-
8277
doLast {
8378
selfExecutableKtlintOutputPath.apply {
8479
logger.lifecycle("Creating the self-executable file: $selfExecutableKtlintOutputPath")
@@ -110,6 +105,11 @@ val shadowJarExecutable by tasks.registering(DefaultTask::class) {
110105
appendBytes(ktlintCliAllJarFile.readBytes())
111106

112107
setExecutable(true, false)
108+
109+
if (signing.isRequired) {
110+
logger.lifecycle("Creating the signature file: $selfExecutableKtlintSignatureOutputPath")
111+
signing.sign(this)
112+
}
113113
}
114114
logger.lifecycle("Creating the batch file for Windows OS: $windowsBatchFileOutputPath")
115115
windowsBatchFileOutputPath.writeText(windowsBatchFileInputPath.readText())

0 commit comments

Comments
 (0)