simplyRoba/pixoo-bridge

add ktfmt for formatting

Closed this issue · 1 comments

https://github.com/diffplug/spotless

plugins { id("com.diffplug.spotless") }

repositories { mavenCentral() }

spotless {
  format("misc") {
    target("**/*.yml", "**/*.yaml", ".gitignore",)
    targetExclude("**/build/**/*", "**/.idea/**")
    trimTrailingWhitespace()
    endWithNewline()
    indentWithSpaces(2)
  }

  kotlin {
    target("**/src/**/*.kt", "**/src/**/*.kts", "**/buildSrc/**/*.kts")
    targetExclude("**/build/**/*.kts", "**/build/**/*.kt")
    ktfmt().googleStyle()
    indentWithSpaces(2)
  }

  kotlinGradle {
    target("**/*.gradle.kts")
    targetExclude("**/build/**/*.gradle.kts")
    ktfmt().googleStyle()
  }

  freshmark { target("*.md") }
}

and manage line endings