Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
0.45.2
->0.46.1
0.45.2
->0.46.1
Release Notes
pinterest/ktlint
v0.46.1
Compare Source
Minor release to address some regressions introduced in 0.46.0
Fixed
-Xuse-k2
as it forces API Consumers to compile their projects with this same flag (#1506).indent
(#1510)v0.46.0
Compare Source
Promoting experimental rules to standard
The rules below are promoted from the
experimental
ruleset to thestandard
ruleset.annotation
annotation-spacing
argument-list-wrapping
double-colon-spacing
enum-entry-name-case
multiline-if-else
no-empty-first-line-in-method-block
package-name
trailing-comma
spacing-around-angle-brackets
spacing-between-declarations-with-annotations
spacing-between-declarations-with-comments
unary-op-spacing
Note that as a result of moving the rules that the prefix
experimental:
has to be removed from all references to this rule. Check references in:.editorconfig
settingdisabled_rules
.VisitorModifier.RunAfterRule
.If your project did not run with the
experimental
ruleset enabled before, you might expect new lint violations to be reported. Please note that rules can be disabled via the the.editorconfig
in case you do not want the rules to be applied on your project.API Changes & RuleSet providers
If you are not an API user nor a RuleSet provider, then you can safely skip this section. Otherwise, please read below carefully and upgrade your usage of ktlint. In this and coming releases, we are changing and adapting important parts of our API in order to increase maintainability and flexibility for future changes. Please avoid skipping a releases as that will make it harder to migrate.
Lint and formatting functions
The lint and formatting changes no longer accept parameters of type
Params
but onlyExperimentalParams
. Also, the VisitorProvider parameter has been removed. Because of this, your integration with KtLint breaks. Based on feedback with ktlint 0.45.x, we now prefer to break at compile time instead of trying to keep the interface backwards compatible. Please raise an issue, in case you help to convert to the new API.Use of ".editorconfig" properties & userData
The interface
UsesEditorConfigProperties
provides methodgetEditorConfigValue
to retrieve a named.editorconfig
property for a given ASTNode. When implementing this interface, the valueeditorConfigProperties
needs to be overridden. Previously it was not checked whether a retrieved property was actually recorded in this list. Now, retrieval of unregistered properties results in an exception.Property
Ktlint.DISABLED
has been removed. The property value can now be retrieved as follows:and be supplied via the
ExperimentalParams
as follows:Property
Ktlint.ANDROID_USER_DATA_KEY
has been removed. The property value can now be retrieved as follows:astNode .getEditorConfigValue(DefaultEditorConfigProperties.codeStyleProperty)
and be supplied via the
ExperimentalParams
as follows:This property defaults to the
official
Kotlin code style when not set.Testing KtLint rules
An AssertJ style API for testing KtLint rules (#1444) has been added. Usage of this API is encouraged in favor of using the old RuleExtension API. For more information, see KtLintAssertThat API
Added
spacing-between-function-name-and-opening-parenthesis
) (#1341)parameter-list-spacing
) (#1341)function-return-type-spacing
) (#1341)nullable-type-spacing
) (#1341)type-parameter-list-spacing
) (#1435)function-start-of-body-spacing
) (#1341)@Suppress
(more information) (#765)function-signature
) (#1341)Fixed
no-consecutive-blank-lines
to new rule (no-blank-lines-in-chained-method-calls
) (#1248)wrapping
(#1457)indent
(#1340)indent
) and a newline in the expression in a for-statement should not force to wrap itwrapping
(#1350)indent
(#1335).editorconfig
settingindentSize
is set to valuetab
then return the default tab width as value forindentSize
(#1485)@file:Suppress(...)
(#1029)Changed
1.7.0
and Kotlin version to1.7.0
.7.1.2
release4.6.3
releasefilename
(#1004)annotation
,annotation-spacing
,argument-list-wrapping
,double-colon-spacing
,enum-entry-name-case
,multiline-if-else
,no-empty-first-line-in-method-block
,package-name
,traling-comma
,spacing-around-angle-brackets
,spacing-between-declarations-with-annotations
,spacing-between-declarations-with-comments
,unary-op-spacing
(#1481)--android
can be omitted when the.editorconfig
propertyktlint_code_style = android
is definedConfiguration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR has been generated by Mend Renovate. View repository job log here.