nbadal / ktlint-intellij-plugin

Ktlint plugin for IntelliJ IDEA + Android Studio
MIT License
158 stars 23 forks source link

Parsing error on valid Gradle scripts #383

Closed Vampire closed 9 months ago

Vampire commented 9 months ago

I have a project with a valid Gradle build script and a valid Gradle settings script. But if I invoke the ktlint 0.20.0-beta-4 formatter on them, I get for the settings script

This file can not be parsed by ktlint. Please resolve all (compilation) errors first. Error: 1:1 Expecting a top level declaration

and for the build script

This file can not be parsed by ktlint. Please resolve all (compilation) errors first. Error: 11:1 Expecting a top level declaration

which for both is the first code line, in the build script there are imports.

paul-dingemans commented 9 months ago

Resolved by #382