Add editorconfig
This commit is contained in:
parent
68fdac4d64
commit
d063ba1c25
@ -10,4 +10,5 @@ val templateModule = module {
|
||||
single { LogbackTemplate(get()) } bind Template::class
|
||||
single { GitignoreTemplate(get()) } bind Template::class
|
||||
single { JunitTemplate(get()) } bind Template::class
|
||||
single { EditorConfigTemplate(get()) } bind Template::class
|
||||
}
|
||||
|
||||
15
src/main/kotlin/starter/templates/EditorConfigTemplate.kt
Normal file
15
src/main/kotlin/starter/templates/EditorConfigTemplate.kt
Normal file
@ -0,0 +1,15 @@
|
||||
package starter.templates
|
||||
|
||||
import com.mitchellbosecke.pebble.PebbleEngine
|
||||
import starter.Project
|
||||
import starter.utils.render
|
||||
|
||||
class EditorConfigTemplate(private val engine: PebbleEngine) : Template {
|
||||
override fun path(project: Project) =
|
||||
".editorconfig"
|
||||
|
||||
override fun enabled(project: Project) = project.features.any { it.name == "ktlint" }
|
||||
|
||||
override fun render(project: Project) =
|
||||
engine.render("starter/editorconfig/index")
|
||||
}
|
||||
18
src/main/resources/starter/editorconfig/index.twig
Normal file
18
src/main/resources/starter/editorconfig/index.twig
Normal file
@ -0,0 +1,18 @@
|
||||
# editorconfig.org
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.{kt, kts}]
|
||||
indent_size = 4
|
||||
insert_final_newline = true
|
||||
continuation_indent_size=4
|
||||
max_line_length = 120
|
||||
disabled_rules = no-wildcard-imports
|
||||
kotlin_imports_layout = idea
|
||||
Loading…
x
Reference in New Issue
Block a user