Hi folks :slightly_smiling_face: I have a question...
# ktlint
m
Hi folks 🙂 I have a question about how to define the import layout since 0.41.0. Previously I had
kotlin_imports_layout = idea
in my
.editorconfig
, which is deprecated now. If I change that to
ij_kotlin_imports_layout = *,java.**,javax.**,kotlin.**,^
like suggested in the deprecation message, the linting with KTLint fails because of wrong import ordering. If I let ktlint format my source files it formats the imports alphabetically. I'm using one of the gradle plugins (https://github.com/jlleitschuh/ktlint-gradle) mentioned in the README to integrate ktlint into my project. Does anyone have any ideas? 🤔
t
@romtsn maybe you could help here?
r
hey, could you post your imports list here? Or better open a github issue 🙂
t
m
Yeah I saw that one too 😅 Unfortunately I have another symptom - the behaviour described in the issue did not happen for me 🤔. Maybe I can try to create a small sample project where I reproduce the issue I have.
r
I have one assumption - if you use
--android
flag and you’ve defined the `ij_kotlin_imports_layout`only for some certain modules/paths, then it could be the reason you’re getting alphabetical order.
but yeah, please try to have a reproducible sample, or just give some more info over a github issue
m
I think it was more of a Gradle cache problem. Should be more related to the gradle-plugin. Everything fine on KTLint side itself 👍 Thanks for the help 🙂
t
yes, the issue in the plugin. Will fix for the next release
🙌 1
most probably
9.4.0
will work fine with
0.41.0