In case an .editorconfig contains multiple globs having specific configuration, on in case the project contains multiple .editorconfig files, the path to the file becomes important for loading the correct settings from the .editorconfig. By default this is supported by ktlint when using the Code.fromFile(..) helper on invocation of the lint(..) or format(..) functions. It can however not be guaranteed that all changes have changed to the physical file before those functions are invoked. In 0.20.0 (with ktlint 1.0.1 a workaround has been implemented.
The helper function Code.fromSnippetWithPath(..) is already in use since version 0.20.1. The rule filename however is still disabled and should have be removed with using the helper function.
In case an
.editorconfig
contains multiple globs having specific configuration, on in case the project contains multiple.editorconfig
files, the path to the file becomes important for loading the correct settings from the.editorconfig
. By default this is supported by ktlint when using theCode.fromFile(..)
helper on invocation of thelint(..)
orformat(..)
functions. It can however not be guaranteed that all changes have changed to the physical file before those functions are invoked. In0.20.0
(with ktlint1.0.1
a workaround has been implemented.With introduction of the new
Code.fromSnippetWithPath(..)
helper in ktlint1.1.x
(https://github.com/pinterest/ktlint/issues/2340) this workaround can be removed.