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.48.1
->0.48.2
0.48.1
->0.48.2
0.48.1
->0.48.2
Release Notes
pinterest/ktlint
v0.48.2
Compare Source
Additional clarification on API Changes in
0.48.0
and0.48.1
Starting with Ktlint
0.48.x
, rule and rule sets can be enabled/disabled with a separate property per rule (set). Please read deprecation of (ktlint_)disable_rules property for more information.API Consumers that provide experimental rules to the KtLintRuleEngine, must also enable the experimental rules or instruct their users to do so in the
.editorconfig
file. From the perspective of the API Consumer it might be confusing or unnecessary to do so as the experimental rule was already provided explicitly.Ktlint wants to provide the user (e.g. a developer) a uniform and consistent user experience. The
.editorconfig
becomes more and more central to store configuration for Ktlint. This to ensure that all team members use the exact same configuration when running ktlint regardless whether the Ktlint CLI or an API Consumer is being used.The
.editorconfig
is a powerful configuration tool which can be used in very different ways. Most projects use a single.editorconfig
file containing one common section for kotlin and kotlin scripts files. For example, the.editorconfig
file of the Ktlint project contains following section:Other projects might contain multiple
.editorconfig
files for different parts of the project directory hierarchy. Or, use a single.editorconfig
file containing multiple sections with different globs. Like all other configuration settings in Ktlint, the user should be able to enable and disable the experimental rules. Both for the entire set of experimental rules and for individual experimental rules.Ktlint allows API Consumers to set default values and override values for the
.editorconfig
. Specifying a default value means that the user does not need to define the property in the.editorconfig
file but if the user specifies the value, it will take precedence. Specifying the override value ensures that this takes precedence on a value specified by the user in the.editorconfig
.From the Ktlint perspective, it is advised that API Consumers provide the default value. See example below, for how to specify the
editorConfigDefault
property:If the user has set property
ktlint_experimental
explicitly than that value will be used. If the value is not defined, the value provided viaeditorConfigDefaults
will be used.If you do want to ignore the value of
ktlint_experimental
as set by the user, than you can set the EditorConfigOverride property. But as said before that is discouraged as the user might not understand why the.editorconfig
property is being ignored (provided that the value set is not equal to the value provided by the API Consumer).Added
Removed
Fixed
annotation
(#1765).editorconfig
propertiesdisabled_rules
orktlint_disabled_rules
are set. (#1771)max-line-length
should be ignored by rulefunction-signature
(#1773)class-naming
,function-naming
,package-name
,property-naming
(#1757)file-name
rule on code snippets (#1768).editorconfig
propertyij_kotlin_imports_layout
's entries (#1770)Changed
Configuration
📅 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.