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

Expose build binding as a configuration #227

Open
2 tasks done
daymxn opened this issue Nov 20, 2023 · 1 comment
Open
2 tasks done

Expose build binding as a configuration #227

daymxn opened this issue Nov 20, 2023 · 1 comment

Comments

@daymxn
Copy link

daymxn commented Nov 20, 2023

⚠️ Is your feature request related to a problem? Please describe

ktfmtCheck binds to check as a dependency- causing build failures if things are not formatted correctly.

💡 Describe the solution you'd like

A configuration option to be exposed to disable this.

Context:
We at Google use ktfmt for a lot of our Kotlin projects, but not everyone wants their code to be formatted while working on a PR. Some folks are fine with it- others not so much. It would be significantly more convenient if we could have the formatting errors be warnings instead of failures during build time, and then rely on our commit hook to run it for failures.

From #46 , it seems this was a design choice. But the suggested workarounds are a bit too involved for a lot of user workflows. Those who work in the terminal don't have much issue with them- but if you're used to just running gradle tasks from the tasklist in Intellij/AS - then this is a bit of a smell. Sure, you can modify the run configuration- or create your own tasks and disable the ones registered automatically (which is what we currently do)- but it would make our lives much easier if we could just toggle it via a plugin or task configuration.

🤚 Do you want to develop this feature yourself?

  • Yes
  • No

We're comfortable creating a PR for this if you don't have the free cycles for it

@cortinico
Copy link
Owner

Would a configuration in the ktfmt extension that controls the return status of the *Check task helps?

Something like:

ktfmt {
    ignoreFailures.set(true)
}

So even if there are failures in the inspection, the build would still be green.

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

No branches or pull requests

2 participants