mirror of
https://github.com/vale981/apheleia
synced 2025-03-05 09:31:40 -05:00
Add ktlint (#97)
* feat: add ktlint * Apply suggestions from code review Co-authored-by: Radon Rosborough <radon.neon@gmail.com>
This commit is contained in:
parent
b5dbab53ea
commit
363d634c5c
5 changed files with 20 additions and 0 deletions
|
@ -21,6 +21,7 @@ The format is based on [Keep a Changelog].
|
||||||
* [dart-format](https://dart.dev/tools/dart-format) for Dart ([#89]).
|
* [dart-format](https://dart.dev/tools/dart-format) for Dart ([#89]).
|
||||||
* [phpcs](https://github.com/squizlabs/PHP_CodeSniffer) for PHP
|
* [phpcs](https://github.com/squizlabs/PHP_CodeSniffer) for PHP
|
||||||
([#87]).
|
([#87]).
|
||||||
|
* [ktlint](https://github.com/pinterest/ktlint) for Kotlin ([#95]).
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
* Support remote files and buffers that were opened through TRAMP
|
* Support remote files and buffers that were opened through TRAMP
|
||||||
|
|
|
@ -927,6 +927,7 @@ being run, for diagnostic purposes."
|
||||||
(gofmt . ("gofmt"))
|
(gofmt . ("gofmt"))
|
||||||
(google-java-format . ("google-java-format" "-"))
|
(google-java-format . ("google-java-format" "-"))
|
||||||
(isort . ("isort" "-"))
|
(isort . ("isort" "-"))
|
||||||
|
(ktlint . ("ktlint" "--stdin" "-F"))
|
||||||
(latexindent . ("latexindent" "--logfile=/dev/null"))
|
(latexindent . ("latexindent" "--logfile=/dev/null"))
|
||||||
(mix-format . ("mix" "format" "-"))
|
(mix-format . ("mix" "format" "-"))
|
||||||
(ocamlformat . ("ocamlformat" "-" "--name" filepath
|
(ocamlformat . ("ocamlformat" "-" "--name" filepath
|
||||||
|
@ -1059,6 +1060,7 @@ function: %s" command)))
|
||||||
(js3-mode . prettier)
|
(js3-mode . prettier)
|
||||||
(js-mode . prettier)
|
(js-mode . prettier)
|
||||||
(json-mode . prettier)
|
(json-mode . prettier)
|
||||||
|
(kotlin-mode . ktlint)
|
||||||
(latex-mode . latexindent)
|
(latex-mode . latexindent)
|
||||||
(LaTeX-mode . latexindent)
|
(LaTeX-mode . latexindent)
|
||||||
(python-mode . black)
|
(python-mode . black)
|
||||||
|
|
4
test/formatters/installers/ktlint.bash
Normal file
4
test/formatters/installers/ktlint.bash
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
ver="$(latest_release pinterest/ktlint)"
|
||||||
|
apt-get install -y default-jre
|
||||||
|
wget "https://github.com/pinterest/ktlint/releases/download/${ver}/ktlint" -O /usr/local/bin/ktlint
|
||||||
|
chmod +x /usr/local/bin/ktlint
|
8
test/formatters/samplecode/ktlint/in.kt
Normal file
8
test/formatters/samplecode/ktlint/in.kt
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
class Test
|
||||||
|
|
||||||
|
{
|
||||||
|
fun test( v: String )
|
||||||
|
{
|
||||||
|
println(v)
|
||||||
|
}
|
||||||
|
}
|
5
test/formatters/samplecode/ktlint/out.kt
Normal file
5
test/formatters/samplecode/ktlint/out.kt
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
class Test {
|
||||||
|
fun test(v: String) {
|
||||||
|
println(v)
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue