Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement missing properties in the configuration closure #171

Open
rock3r opened this issue Jan 10, 2021 · 10 comments
Open

Implement missing properties in the configuration closure #171

rock3r opened this issue Jan 10, 2021 · 10 comments

Comments

@rock3r
Copy link

rock3r commented Jan 10, 2021

Right now there is no way to set the --debug, --baseline, and --editorconfig ktlint flags. it would be great to have that possibility. I'd imagine those being additional properties on the kotlinter closure:

kotlinter {
    // ...
    debug = false
    baseline = file(...)
    editorconfig = file(...)
}
@jeremymailen
Copy link
Owner

Thanks for the note!
The baseline would be a new feature, see #167. Probably based on demand -- do you use it?

Wondering about editorconfig as well -- since it's a build script would it make sense to refer to a personal location over an editorconfig in the standard location checked into the project? Certainly could support it if people want to use it vs allowing ktlint to automatically locate editorconfig in the standard places.

For debug, would it make sense to pass through gradle's --debug flag when it is on? This would align to the same way you'd debug the kotlinter plugin itself.

@rock3r
Copy link
Author

rock3r commented Jan 13, 2021

Hey there!

Baseline: not yet, but I would if it were available, at least in one project I work on.

Editorconfig: would use it mostly for debugging my own editorconfig when the build fails and I can't figure out why :)

As for debug: tying it with Gradle's by default sounds reasonable, however I'd most likely want to only debug ktlint runs on their own, and their debug output would risk getting lost in Gradle's very, very verbose debug output, I think

@jeremymailen
Copy link
Owner

Ok, makes sense. Will try to put these in queue for next dot release.

@rock3r
Copy link
Author

rock3r commented Jul 20, 2022

Hi there — once again, I'd need the editorconfig property. The new use case is that I am applying the Kotlinter configuration to subprojects via a compiled script plugin and it's not picking up the .editorconfig file in the root of the repository, so I need to explicitly point to it.

@mateuszkwiecinski
Copy link
Contributor

mateuszkwiecinski commented Jul 20, 2022

Hey @rock3r 👋 - if ktlint doesn't pick your .editorconfig you might be observing #262 and the temporary workaround is to kill gradle daemon using ./gradlew --stop

@rock3r
Copy link
Author

rock3r commented Jul 21, 2022

I'll check and let you know :) Thanks for the pointer

@rock3r
Copy link
Author

rock3r commented Jul 25, 2022

That did the trick, thanks @mateuszkwiecinski 👍

@chrisjenx
Copy link

THanks @mateuszkwiecinski that fixed a different issue I was seeing

@mateuszkwiecinski
Copy link
Contributor

@chrisjenx I'm happy it helped 😃 Would you mind sharing what your issue was specifically and if it is still reproducible in the latest release 3.12.0?

@chrisjenx
Copy link

Updating editorconfig. isnt reflected until you call gradle --stop sometimes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants