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
Kotlin script files (.kts) #35
Comments
Looks like
Something inside |
Had to rollback the changes that added support for scripts, so reopening. |
Are there any news regarding support for Kotlin Script files? It would be very useful to us as we are currently using ktlint but we would like to migrate to ktfmt for both normal and script Kotlin files. |
@jdemeulenaere glad you find ktfmt useful :) |
Summary: The formatting is inherited from non-kts files, so each statement is surrounded by newlines. Follow-up: only force newlines between certain constrcuts, such as classes. This unblocks #35 . Reviewed By: strulovich Differential Revision: D25743859 fbshipit-source-id: 8dbda2866ea50eb4a73d94a72d2b7f10618a4cd0
There's now preliminary support in the main branch. It'll do undesirable things like surrounding every statement in newlines, but at least it ktfmt no longer chokes on kts files. |
Is there a snapshot for it? |
I uploaded a snapshot to
see https://stackoverflow.com/questions/7715321/how-to-download-snapshot-version-from-maven-snapshot-repository for hwo to add the OSSRH snapshot repo to your Maven repo list. |
Hi, everything seems to be ok now, with just a small problem : formatting scripts starting by a hashbang will fail |
@cgrushko would you be open to a PR for the hashbang support via just peeking the first line and skipping it if it is a hashbang? |
@ZacSweers was just implemented in d71487b :) next weekly release should pick it up. |
ktfmt looks good so far! Only deficiency I have found is that it doesn't work on script (.kts) files. Any chance of adding this?
The text was updated successfully, but these errors were encountered: