Gradle plugin exposing a long-running HTTP daemon to format code using Spotless.
Designed as a companion for integrating spotless into IDEs with higher throughput.
In your buildscript, apply the plugin:
plugins {
id("com.diffplug.spotless")
id("dev.ghostflyby.spotless.daemon")
}Don't forget to apply the com.diffplug.spotless plugin
Specify address with gradle properties and start the daemon:
./gradlew spotlessDaemon -Pdev.ghostflyby.spotless.daemon.port=8080
./gradlew spotlessDaemon -Pdev.ghostflyby.spotless.daemon.unixsocket=/path/to/socketThe task will block, running the daemon until interrupted.
200 OKas a health check
400 Bad Requestifpathparameter is missing404 Not Foundif file not covered by spotless, either no such file or not included in config.200 OKwith encoding name astext/plainin body if successful
404 Not Foundif file not covered by spotless, either no such file or not included in config.400 Bad Requestifpathparameter is missing200 OKwith formatted file content astext/plainin body if successful200 OKwith empty body if no changes were made500 Internal Server Errorif problems occurred during formatting
404 Not Foundif file not covered by spotless, either no such file or not included in config.200 OKwith empty body if file covered by spotless
200 OKand stops the daemon