You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ".editorconfig" setting max_line_length influences some standard/experimental rules of KtLint. Also this property might be used by externally provided rulesets.
Since ktlint version 0.45.0, for android only the standard/experimental rules no longer respects the special value "unset" or the case in which the property has not been defined at all. In those case the max_line_length property should be defaulted to 100. In case that a rule derives the value from the userData via key EDITOR_CONFIG_PROPERTIES_USER_DATA_KEY as is recommended, the value -1 is returned which effectively disables the rules. In case thet rules still uses the deprecated key EDITOR_CONFIG_USER_DATA_KEY the correct value 100 is returned.
If the property has been set to an integer value or to the special value "off", the rules are working as before.
The text was updated successfully, but these errors were encountered:
From the perspective of the Rule developer, simplify the
retrieval of an ".editorconfig" property for the current
ASTNode. By using the ASTNode as receiver, it is no
longer needed to pass the "isAndroidCodeStyle" boolean
as well.
All logic regarding the determination of the actual
value of the property is now defined as part of the
definition of that property instead of being spread
around multiple places in the ktlint code. Especially
the handling of value "unset" (for properties
max_line_length and indent_size) and "off" (property
max_line_length) is now clearly centralized. This
closespinterest#1387.
Property definitions indentStyleProperty,
indentSizeProperty, insertNewLineProperty and
maxLineLengthProperty are moved to the
DefaultEditorConfigProperties as those properties are
based on types provided by the ec4j library.
Class IndentConfig now needs to be initialized based
on the values of ".editorconfig" properties
indentStyleProperty and indentSizeProperty. Although,
this is less convenient, it is more explicit and
consistent with how rules should interact with the
".editorconfig" properties.
All rules provided by KtLint itself, now only use the
interface UsesEditorConfigProperties to retrieve values
for the ".editorconfig" property. As a result, the
EditConfig became obsolete. It is marked for deletion
in Ktlint 0.46.
…1389)
From the perspective of the Rule developer, simplify the
retrieval of an ".editorconfig" property for the current
ASTNode. By using the ASTNode as receiver, it is no
longer needed to pass the "isAndroidCodeStyle" boolean
as well.
All logic regarding the determination of the actual
value of the property is now defined as part of the
definition of that property instead of being spread
around multiple places in the ktlint code. Especially
the handling of value "unset" (for properties
max_line_length and indent_size) and "off" (property
max_line_length) is now clearly centralized. This
closes#1387.
Property definitions indentStyleProperty,
indentSizeProperty, insertNewLineProperty and
maxLineLengthProperty are moved to the
DefaultEditorConfigProperties as those properties are
based on types provided by the ec4j library.
Class IndentConfig now needs to be initialized based
on the values of ".editorconfig" properties
indentStyleProperty and indentSizeProperty. Although,
this is less convenient, it is more explicit and
consistent with how rules should interact with the
".editorconfig" properties.
All rules provided by KtLint itself, now only use the
interface UsesEditorConfigProperties to retrieve values
for the ".editorconfig" property. As a result, the
EditConfig became obsolete. It is marked for deletion
in Ktlint 0.46.
The ".editorconfig" setting max_line_length influences some standard/experimental rules of KtLint. Also this property might be used by externally provided rulesets.
Since ktlint version 0.45.0, for android only the standard/experimental rules no longer respects the special value "unset" or the case in which the property has not been defined at all. In those case the max_line_length property should be defaulted to 100. In case that a rule derives the value from the userData via key EDITOR_CONFIG_PROPERTIES_USER_DATA_KEY as is recommended, the value -1 is returned which effectively disables the rules. In case thet rules still uses the deprecated key EDITOR_CONFIG_USER_DATA_KEY the correct value 100 is returned.
If the property has been set to an integer value or to the special value "off", the rules are working as before.
The text was updated successfully, but these errors were encountered: