From b99cfa8807a2863d7929548410f0e94847b076fe Mon Sep 17 00:00:00 2001 From: Paul Dingemans Date: Thu, 5 Dec 2024 09:26:12 +0100 Subject: [PATCH] Updated refs to latest (1.5.0) release (#2897) Co-authored-by: Ktlint Release Workflow --- .../release-latest/docs/install/cli.md | 4 ++-- .../docs/install/integrations.md | 6 +++--- .../release-latest/docs/rules/standard.md | 19 +++++++++++++++++-- documentation/snapshot/docs/install/cli.md | 4 ++-- .../snapshot/docs/install/integrations.md | 6 +++--- 5 files changed, 27 insertions(+), 12 deletions(-) diff --git a/documentation/release-latest/docs/install/cli.md b/documentation/release-latest/docs/install/cli.md index 79c36f975a..9d2f73a4ea 100644 --- a/documentation/release-latest/docs/install/cli.md +++ b/documentation/release-latest/docs/install/cli.md @@ -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.4.1/ktlint && chmod a+x ktlint && sudo mv ktlint /usr/local/bin/ +curl -sSLO https://github.com/pinterest/ktlint/releases/download/1.5.0/ktlint && chmod a+x ktlint && sudo mv ktlint /usr/local/bin/ ``` !!! tip "Curl not installed or behind proxy" @@ -207,6 +207,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.4.1). 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.5.0). Add the batch file to your `%PATH%` environment variable for easy access 2. Run `ktlint` using Git Bash 3. Run as `java -jar ktlint` diff --git a/documentation/release-latest/docs/install/integrations.md b/documentation/release-latest/docs/install/integrations.md index 1bb7711ec1..3029801e3b 100644 --- a/documentation/release-latest/docs/install/integrations.md +++ b/documentation/release-latest/docs/install/integrations.md @@ -56,7 +56,7 @@ See [cli usage](../cli) for arguments that can be supplied to `ktlint`. com.pinterest.ktlint ktlint-cli - 1.4.1 + 1.5.0 @@ -117,7 +117,7 @@ configurations { } dependencies { - ktlint("com.pinterest.ktlint:ktlint-cli:1.4.1") { + ktlint("com.pinterest.ktlint:ktlint-cli:1.5.0") { attributes { attribute(Bundling.BUNDLING_ATTRIBUTE, getObjects().named(Bundling, Bundling.EXTERNAL)) } @@ -167,7 +167,7 @@ The configuration below, defines following task: val ktlint by configurations.creating dependencies { - ktlint("com.pinterest.ktlint:ktlint-cli:1.4.1") { + ktlint("com.pinterest.ktlint:ktlint-cli:1.5.0") { attributes { attribute(Bundling.BUNDLING_ATTRIBUTE, objects.named(Bundling.EXTERNAL)) } diff --git a/documentation/release-latest/docs/rules/standard.md b/documentation/release-latest/docs/rules/standard.md index 6f42ace382..af4718dfbb 100644 --- a/documentation/release-latest/docs/rules/standard.md +++ b/documentation/release-latest/docs/rules/standard.md @@ -1253,10 +1253,18 @@ Allows property names to start with `_` in case the property is a backing proper ```kotlin class Bar { - // Backing property + // Backing property as normal class member private val _elementList = mutableListOf() val elementList: List get() = _elementList + + // Backing property defined in companion object + val elementList2: List + get() = _elementList2 + + companion object { + private val _elementList2 = mutableListOf() + } } ``` === "[:material-heart-off-outline:](#) Disallowed" @@ -1505,6 +1513,13 @@ Enforce naming of property. This rule is suppressed whenever the IntelliJ IDEA inspection suppression `PropertyName`, `ConstPropertyName`, `ObjectPropertyName` or `PrivatePropertyName` is used. +| Configuration setting | ktlint_official | intellij_idea | android_studio | +|:-----------------------------------------------------------------------------------------------------------------------------------------------|:----------------------:|:----------------------:|:----------------------:| +| `ktlint_property_naming_constant_naming`
The naming style ('screaming_snake_case', or 'pascal_case') to be applied on constant properties. | `screaming_snake_case` | `screaming_snake_case` | `screaming_snake_case` | + +!!! note + When using Compose, you might want to configure the `ktlint_property_naming_constant_naming-naming` rule with `.editorconfig` property `ktlint_property_naming_constant_naming = pascal_case`. + Rule id: `standard:property-naming` Suppress or disable rule (1) @@ -4345,7 +4360,7 @@ Suppress or disable rule (1) ### Context receiver wrapping -Wraps the context receiver list to a separate line regardless of maximum line length. If the maximum line length is configured and is exceeded, wrap the context receivers and if needed its projection types to separate lines. +Wraps the context receiver list of a function to a separate line regardless of maximum line length. If the maximum line length is configured and is exceeded, wrap the context receivers and if needed its projection types to separate lines. === "[:material-heart:](#) Ktlint" diff --git a/documentation/snapshot/docs/install/cli.md b/documentation/snapshot/docs/install/cli.md index 79c36f975a..9d2f73a4ea 100644 --- a/documentation/snapshot/docs/install/cli.md +++ b/documentation/snapshot/docs/install/cli.md @@ -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.4.1/ktlint && chmod a+x ktlint && sudo mv ktlint /usr/local/bin/ +curl -sSLO https://github.com/pinterest/ktlint/releases/download/1.5.0/ktlint && chmod a+x ktlint && sudo mv ktlint /usr/local/bin/ ``` !!! tip "Curl not installed or behind proxy" @@ -207,6 +207,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.4.1). 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.5.0). Add the batch file to your `%PATH%` environment variable for easy access 2. Run `ktlint` using Git Bash 3. Run as `java -jar ktlint` diff --git a/documentation/snapshot/docs/install/integrations.md b/documentation/snapshot/docs/install/integrations.md index 1bb7711ec1..3029801e3b 100644 --- a/documentation/snapshot/docs/install/integrations.md +++ b/documentation/snapshot/docs/install/integrations.md @@ -56,7 +56,7 @@ See [cli usage](../cli) for arguments that can be supplied to `ktlint`. com.pinterest.ktlint ktlint-cli - 1.4.1 + 1.5.0 @@ -117,7 +117,7 @@ configurations { } dependencies { - ktlint("com.pinterest.ktlint:ktlint-cli:1.4.1") { + ktlint("com.pinterest.ktlint:ktlint-cli:1.5.0") { attributes { attribute(Bundling.BUNDLING_ATTRIBUTE, getObjects().named(Bundling, Bundling.EXTERNAL)) } @@ -167,7 +167,7 @@ The configuration below, defines following task: val ktlint by configurations.creating dependencies { - ktlint("com.pinterest.ktlint:ktlint-cli:1.4.1") { + ktlint("com.pinterest.ktlint:ktlint-cli:1.5.0") { attributes { attribute(Bundling.BUNDLING_ATTRIBUTE, objects.named(Bundling.EXTERNAL)) }