This repository has been archived by the owner on Oct 22, 2023. It is now read-only.
Update dependency com.pinterest:ktlint to v0.48.1 #310
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.47.1
->0.48.1
Release Notes
pinterest/ktlint
v0.48.1
Compare Source
Added
Removed
Fixed
no-semi
(#1733)standard:filename
rule whenever Ktlint CLI is run with option--stdin
(#1742)--log-level
is specified. Throw exception when an invalid value is passed. (#1749)experimental
rule set are disabled by default. (#1747)Changed
1.8.0
and Kotlin version to1.8.0
.v0.48.0
Compare Source
Indent rule
The
indent
rule has been rewritten from scratch. Solving problems in the old algorithm was very difficult. With the new algorithm this becomes a lot easier. Although the new implementation of the rule has been compared against several open source projects containing over 400,000 lines of code, it is still likely that new issues will be discovered. Please report your indentation issues so that these can be fixed as well..editorconfig
property to disable rulesIn the previous release (0.47.x), the
.editorconfig
propertydisabled_rules
was deprecated and replaced withktlint_disabled_rules
. This latter property has now been deprecated as well in favour of a more flexible and better maintainable solution. Rule and rule sets can now be enabled/disabled with a separate property per rule (set). Please read deprecation of (ktlint_)disable_rules property for more information.The KtLint CLI has not been changed. Although you can still use parameter
--experimental
to enable KtLint's Experimental rule set, you might want to set.editorconfig
propertyktlint_experimental = enabled
instead.API Changes & RuleSet providers
If you are not an API consumer or Rule Set provider then you can skip this section.
Class relocations
Classes below have been relocated:
com.pinterest.ktlint.core.api.UsesEditorConfigProperties.EditorConfigProperty
has been replaced withcom.pinterest.ktlint.core.api.editorconfig.EditorConfigProperty
.com.pinterest.ktlint.core.KtLintParseException
has been replaced withcom.pinterest.ktlint.core.api.KtLintParseException
.com.pinterest.ktlint.core.RuleExecutionException
has been replaced withcom.pinterest.ktlint.core.api.KtLintRuleException
.com.pinterest.ktlint.reporter.format.internal.Color
has been moved tocom.pinterest.ktlint.reporter.format.Color
.com.pinterest.ktlint.reporter.plain.internal.Color
has been moved tocom.pinterest.ktlint.reporter.plain.Color
.Invoking
lint
andformat
This is the last release that supports the
ExperimentalParams
to invoke thelint
andformat
functions of KtLint. TheExperimentalParams
contains a mix of configuration settings which are not dependent on the file/code which is to be processed. Other parameters in that class describe the code/file to be processed but can be configured inconsistently (for example a file with name "foo.kt" could be marked as a Kotlin Script file).The static object
KtLint
is deprecated and replaced by classKtLintRuleEngine
which is configured withKtLintRuleEngineConfiguration
. The instance of theKtLintRuleEngine
is intended to be reused for scanning all files in a project and should not be recreated per file.Both
lint
andformat
are simplified and can now be called for a code block or for an entire file.Retrieve
.editorconfig
sThe list of
.editorconfig
files which will be accessed by KtLint when linting or formatting a given path can now be retrieved with the new APIKtLint.editorConfigFilePaths(path: Path): List<Path>
.This API can be called with either a file or a directory. It's intended usage is that it is called once with the root directory of a project before actually linting or formatting files of that project. When called with a directory path, all
.editorconfig
files in the directory or any of its subdirectories (except hidden directories) are returned. In case the given directory does not contain an.editorconfig
file or if it does not contain theroot=true
setting, the parent directories are scanned as well until a root.editorconfig
file is found.Calling this API with a file path results in the
.editorconfig
files that will be accessed when processing that specific file. In case the directory in which the file resides does not contain an.editorconfig
file or if it does not contain theroot=true
setting, the parent directories are scanned until a root.editorconfig
file is found.Psi filename replaces FILE_PATH_USER_DATA_KEY
Constant
KtLint.FILE_PATH_USER_DATA_KEY
is deprecated and will be removed in KtLint version 0.49.0. The file name will be passed correctly to the node with element type FILE and can be retrieved as follows:Added
wrapping
(#1643)stdin
with the--patterns-from-stdin
command line options/flags (#1606)indent
rule and new experimental rulecontext-receiver-wrapping
(#1672)class-naming
), functions (function-naming
) and properties (property-naming
) (#44)plain-summary
which prints a summary the number of violation which have been autocorrected or could not be autocorrected, both split by rule.Fixed
.editorconfig
when running CLI with options--stdin
and--editorconfig
(#1651)trailing-comma-on-call-site
(#1642)ktlint_disabled_rules
to exposededitorConfigProperties
(#1671)trailing-comma-on-declaration-site
andtrailing-comma-on-call-site
(#1676)function-signature
(#1690)Changed
1.8.0-RC
and Kotlin version to1.7.21
.true
unless theandroid codestyle
is enabled. Note that KtLint from a consistency viewpoint enforces the trailing comma on call site while default IntelliJ IDEA formatting only allows the trailing comma but leaves it up to the developer's discretion. (#1670)true
unless theandroid codestyle
is enabled. Note that KtLint from a consistency viewpoint enforces the trailing comma on declaration site while default IntelliJ IDEA formatting only allows the trailing comma but leaves it up to the developer's discretion. (#1669)--debug
,--trace
,--verbose
and-v
are replaced with--log-level=<level>
or the short version `-l=, see CLI log-level. (#1632)--log-level=none
or-l=none
(#1652)indent
rule. Solving problems in the old algorithm was very difficult. With the new algorithm this becomes a lot easier. Although the new implementation of the rule has been compared against several open source projects containing over 400,000 lines of code, it is still likely that new issues will be discovered. Please report your indentation issues so that these can be fixed as well. (#1682, #1321, #1200, #1562, #1563, #1639)indent
rule. Solving problems in the old algorithm was very difficult. With the new algorithm this becomes a lot easier. Although the new implementation of the rule has been compared against several open source projects containing over 400,000 lines of code, it is still likely that new issues will be discovered. Please report your indentation issues so that these can be fixed as well. (#1682, #1321, #1200, #1562, #1563, #1639, #1688)java 19
, remove support for running tests onjava 18
.io.github.detekt.sarif4k:sarif4k
version to0.2.0
(#1701).Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.