Skip to content

Commit

Permalink
Merge branch 'master' into 2453-max-line-length
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-dingemans authored Jan 23, 2024
2 parents d67f4ee + f7557d2 commit 1b7e0b9
Show file tree
Hide file tree
Showing 28 changed files with 971 additions and 675 deletions.
50 changes: 50 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,55 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/).

## [Unreleased]

### Added

### Removed

### Fixed

### Changed

## [1.1.1] - 2024-01-08

### 🆕 Features

None

### 🔧 Fixes


* Fix incorrect generateEditorConfig example in documentation - [#2444](https://github.com/pinterest/ktlint/pull/2444), by @stay7

* Fix insert of suppression on binary expression - [#2463](https://github.com/pinterest/ktlint/pull/2463), by @paul-dingemans

* Loosen dependency between chain-method-continuation and argument-list-wrapping - [#2468](https://github.com/pinterest/ktlint/pull/2468), by @paul-dingemans

* Keep arrow when both parameter list and block of function literal are empty - [#2469](https://github.com/pinterest/ktlint/pull/2469), by @paul-dingemans

* Improve wrapping of binary expressions - [#2479](https://github.com/pinterest/ktlint/pull/2479), by @paul-dingemans

* Resolve conflict between parameter-list-spacing and parameter-list-wrapping - [#2491](https://github.com/pinterest/ktlint/pull/2491), by @paul-dingemans

* Do not wrap binary expression value argument if it is already preceded by a newline - [#2493](https://github.com/pinterest/ktlint/pull/2493), by @paul-dingemans

* Fix operator spacing - [#2473](https://github.com/pinterest/ktlint/pull/2473), by @paul-dingemans

* Run `argument-list-wrapping`, `class-signature` and `function-signature` when comment rules are disabled - [#2466](https://github.com/pinterest/ktlint/pull/2466), by @paul-dingemans

### 📦 Dependencies

* fix(deps): update kotlin monorepo to v1.9.22 - [#2456](https://github.com/pinterest/ktlint/pull/2456), by @renovate[bot]

* chore(deps): update actions/setup-python action to v5 - [#2417](https://github.com/pinterest/ktlint/pull/2417), by @renovate[bot]

* fix(deps): update dependency org.slf4j:slf4j-simple to v2.0.10 - [#2470](https://github.com/pinterest/ktlint/pull/2470), by @renovate[bot]

* fix(deps): update dependency dev.drewhamilton.poko:poko-gradle-plugin to v0.15.2 - [#2485](https://github.com/pinterest/ktlint/pull/2485), by @renovate[bot]

* fix(deps): update dependency org.assertj:assertj-core to v3.25.1 - [#2486](https://github.com/pinterest/ktlint/pull/2486), by @renovate[bot]

## [1.1.0] - 2023-12-19

### 🆕 Features
Expand Down Expand Up @@ -2262,6 +2311,7 @@ set in `[*{kt,kts}]` section).

## 0.1.0 - 2016-07-27

[1.1.1]: https://github.com/pinterest/ktlint/compare/1.1.1...1.1.0
[1.1.0]: https://github.com/pinterest/ktlint/compare/1.0.1...1.1.0
[1.0.1]: https://github.com/pinterest/ktlint/compare/1.0.0...1.0.1
[1.0.0]: https://github.com/pinterest/ktlint/compare/0.50.0...1.0.0
Expand Down
18 changes: 9 additions & 9 deletions RELEASE_TESTING.MD
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Before releasing a new version of KtLint, the release candidate is tested on a s
```
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):
```shell
alias ktlint-prev="ktlint-0.50.0 $@" # Replace with the latest release version
alias ktlint-prev="ktlint-1.1.0 $@" # Replace with the latest release version
```
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.
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):
Expand Down Expand Up @@ -112,8 +112,8 @@ Formatting projects in which ktlint is not used may result in a huge amount of f
```shell
./exec-in-each-project.sh "git add --all && git commit -m \"Format with previous ktlint version -F\""
```
Repeat step 3 and 4 until no files are changed anymore. Starting from 0.50, all changes should be resolved in one run as format internally reruns 3 times in case new violations are introduced which can be autocorrected as well.
5. Check that besides the `baseline.xml` no files are changed (in step 1 and 2 all violations which could be autocorrected have already been committed). Remaining violations which could not be autocorrected are saved in the `baseline.xml` which is stored outside the project directories.
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.
5. Check that besides the `baseline.xml` no files are changed (in step 3 and 4 all violations which could be autocorrected have already been committed). Remaining violations which could not be autocorrected are saved in the `baseline.xml` which is stored outside the project directories.
```shell
./exec-in-each-project.sh "git status"
```
Expand All @@ -127,20 +127,20 @@ Formatting projects in which ktlint is not used may result in a huge amount of f
ktlint-dev --baseline=baseline.xml --relative --reporter=plain-summary # Do not call this command via the "./exec-in-each-project.sh" script as we want to use the one combined baseline.xml file for all projects.
```
Inspect the output roughly (detailed inspection is done when formatting):
* Is the amount of logging messages comparable to before? If not, are the changes intended?
* Are violations related to rules that have actually been added or changed?
* Is the amount of logging messages comparable to before? If not, are the changes intended?
* Are violations related to rules that have actually been added or changed?
7. Format with *latest development* version:
```shell
ktlint-dev -F --baseline=baseline.xml --relative # Do not call this command via the "./exec-in-each-project.sh" script as we want to use the one combined baseline.xml file for all projects.
```
Inspect the output carefully:
* If you see an error like below, then this version obviously may *not* be released. It is best to fix this error before continuing with testing and validating!
* If you see an error like below, then this version obviously may *not* be released. It is best to fix this error before continuing with testing and validating!
```plain
Internal Error (...) in file '...' at position '0:0. Please create a ticket at https://github.com/pinterest/ktlint/issues ...
```
* Ideally, no violations are shown. This means that all violations have been autocorrected.
* Violations which could not be autocorrected should be validated for correctness but do not block the release as most likely this is intended behavior.
* 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.
* Ideally, no violations are shown. This means that all violations have been autocorrected.
* Violations which could not be autocorrected should be validated for correctness but do not block the release as most likely this is intended behavior.
* 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.
8. 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:
```shell
./exec-in-each-project.sh "git add --all && git commit -m \"Fixed with latest development version\""
Expand Down
2 changes: 1 addition & 1 deletion build-logic/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ dependencyResolutionManagement {
}

plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0"
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
}
4 changes: 2 additions & 2 deletions documentation/release-latest/docs/install/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ All releases of `ktlint` can be downloaded from the [releases](https://github.co
A particular version of `ktlint` can be downloaded with next command which also changes the file to an executable in directory `/usr/local/bin`:

```sh title="Download"
curl -sSLO https://github.com/pinterest/ktlint/releases/download/1.1.0/ktlint && chmod a+x ktlint && sudo mv ktlint /usr/local/bin/
curl -sSLO https://github.com/pinterest/ktlint/releases/download/1.1.1/ktlint && chmod a+x ktlint && sudo mv ktlint /usr/local/bin/
```

!!! tip "Curl not installed or behind proxy"
Expand Down Expand Up @@ -209,6 +209,6 @@ Options `--stdin` and `--patterns-from-stdin` are mutually exclusive, only one o

Microsoft Windows is not able to run the `ktlint` command directly. Ktlint can be run in following ways on Microsoft Windows:

1. Use the `ktlint.bat` batch file provided as part of the [release](https://github.com/pinterest/ktlint/releases/tag/1.1.0). Add the batch file to your `%PATH%` environment variable for easy access
1. Use the `ktlint.bat` batch file provided as part of the [release](https://github.com/pinterest/ktlint/releases/tag/1.1.1). Add the batch file to your `%PATH%` environment variable for easy access
2. Run `ktlint` using Git Bash
3. Run as `java -jar ktlint`
6 changes: 3 additions & 3 deletions documentation/release-latest/docs/install/integrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ See [cli usage](../cli) for arguments that can be supplied to `ktlint`.
<dependency>
<groupId>com.pinterest.ktlint</groupId>
<artifactId>ktlint-cli</artifactId>
<version>1.1.0</version>
<version>1.1.1</version>
</dependency>
<!-- additional 3rd party ruleset(s) can be specified here -->
</dependencies>
Expand Down Expand Up @@ -117,7 +117,7 @@ configurations {
}
dependencies {
ktlint("com.pinterest.ktlint:ktlint-cli:1.1.0") {
ktlint("com.pinterest.ktlint:ktlint-cli:1.1.1") {
attributes {
attribute(Bundling.BUNDLING_ATTRIBUTE, getObjects().named(Bundling, Bundling.EXTERNAL))
}
Expand Down Expand Up @@ -167,7 +167,7 @@ The configuration below, defines following task:
val ktlint by configurations.creating

dependencies {
ktlint("com.pinterest.ktlint:ktlint-cli:1.1.0") {
ktlint("com.pinterest.ktlint:ktlint-cli:1.1.1") {
attributes {
attribute(Bundling.BUNDLING_ATTRIBUTE, objects.named(Bundling.EXTERNAL))
}
Expand Down
Loading

0 comments on commit 1b7e0b9

Please sign in to comment.