https://kotlinlang.org logo
#opensource
Title
# opensource
r

Robert Menke

09/22/2020, 2:07 PM
Curious to know if there’s something like Prettier for android projects. I have KtLint set up & working but I love the workflow in the javascript world of autoformatting the file I’m working out of automatically when I press save.
c

Casey Brooks

09/22/2020, 2:32 PM
I rely on IntelliJ’s formatter for this. Making a keybinding for it makes it simple to format the file I’m working on
c

Czar

09/22/2020, 2:45 PM
I believe detekt has a formatter, but I also rely on IntelliJ
c

Casey Brooks

09/22/2020, 2:48 PM
For a workflow you don’t have to manually initiate, you might also be able to leverage IntelliJ’s File Watchers to run the ktlint formatter on save. Or create a git pre-commit hook to run it when committing your changes
r

Robert Menke

09/22/2020, 3:15 PM
Ya I have the pre-commit hook set up I just want it to auto-format on save
4 Views