Lines Matching +full:maven +full:- +full:settings
1 …Maven Central Version](https://img.shields.io/maven-central/v/com.facebook/ktfmt)](https://central…
3 `ktfmt` is a program that pretty-prints (formats) Kotlin code, based on
4 [google-java-format](https://github.com/google/google-java-format).
11 | ---- | ---- |
18 | ------ | --------|
31 A [ktfmt IntelliJ plugin](https://plugins.jetbrains.com/plugin/14912-ktfmt) is available from the
32 plugin repository. To install it, go to your IDE's settings and select the `Plugins` category. Click
36 `File → Settings... → ktfmt Settings` (or `IntelliJ IDEA → Preferences... → Editor → ktfmt Settings`
41 `File → New Project Settings → Preferences for new Projects → Editor → ktfmt Settings`.
44 `Code` menu or with the Ctrl-Alt-L (by default) keyboard shortcut.
48 [`.editorconfig` file](https://www.jetbrains.com/help/idea/configuring-code-style.html#editorconfig)
51 #### Share IntelliJ ktfmt settings
52 In order to share the settings, make sure to commit the file `.idea/ktfmt.xml` into your codebase.
65 ### from the command-line
70 java -jar /path/to/ktfmt-<VERSION>-jar-with-dependencies.jar [--kotlinlang-style | --google-style] …
73 `--kotlinlang-style` makes `ktfmt` use a block indent of 4 spaces instead of 2.
83 A [Gradle plugin (ktfmt-gradle)](https://github.com/cortinico/ktfmt-gradle) is available on the
85 [How-to-use section](https://github.com/cortinico/ktfmt-gradle#how-to-use-).
88 [ktfmt Gradle plugin](https://github.com/diffplug/spotless/tree/main/plugin-gradle#ktfmt).
90 ### using Maven
93 [ktfmt Maven plugin](https://github.com/diffplug/spotless/tree/main/plugin-maven#ktfmt).
95 ### using pre-commit hooks
97 A [pre-commit hook](https://pre-commit.com/hooks.html) is implemented in
98 [language-formatters-pre-commit-hooks](https://github.com/macisamuele/language-formatters-pre-commi…
104 `ktfmt` uses google-java-format's underlying engine, and as such, many items on
105 [google-java-format's FAQ](https://github.com/google/google-java-format/wiki/FAQ) apply to `ktfmt`
112 …https://github.com/google/google-java-format/wiki/FAQ#i-just-need-to-configure-it-a-bit-differentl…
122 nice-looking code that fits in 100 columns, as can be seen in the [Demo](README.md#Demo) section.
124 ### `ktfmt` uses a 2-space indent; why not 4? any way to change that?
126 Two reasons -
127 1. Many of our projects use a mixture of Kotlin and Java, and we found the back-and-forth in styles
129 2. From a pragmatic standpoint, the formatting engine behind google-java-format uses more whitespace
134 `ktfmt` because of 2-space: the style `--kotlinlang-style` changes block indents to 4-space.
143 `Settings → Build, Execution, Deployment → Compiler → Java Compiler` (see
144 https://github.com/google/google-java-format/issues/417)
153 * Run `java -jar core/target/ktfmt-<VERSION>-jar-with-dependencies.jar`