-
-
Notifications
You must be signed in to change notification settings - Fork 369
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [x] Needs #3919 as this builds on it * [x] Update this to use #3961, switching to `KtlintModule` * [x] Needs #3966 to disable ktlint for some files Last change I think needed for #3829 Overview: * Changes `KtfmtModule` to set the error code when there's changes like is true of the other formatters. * Some simplifications were made to the `example/package.mill` based on similarities with Java/Kotlin. * Files were formatted * CI was updated --------- Co-authored-by: Li Haoyi <[email protected]>
- Loading branch information
Showing
72 changed files
with
955 additions
and
808 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,19 @@ | ||
package foo | ||
|
||
import kotlinx.html.h1 | ||
import kotlinx.html.stream.createHTML | ||
import com.github.ajalt.clikt.core.CliktCommand | ||
import com.github.ajalt.clikt.parameters.options.option | ||
import com.github.ajalt.clikt.parameters.options.required | ||
import kotlinx.html.h1 | ||
import kotlinx.html.stream.createHTML | ||
|
||
class Foo: CliktCommand() { | ||
val text by option("-t", "--text", help="text to insert").required() | ||
class Foo : CliktCommand() { | ||
val text by option("-t", "--text", help = "text to insert").required() | ||
|
||
override fun run() { | ||
echo(generateHtml(text)) | ||
} | ||
} | ||
|
||
fun generateHtml(text: String): String { | ||
return createHTML(prettyPrint = false).h1 { text(text) }.toString() | ||
} | ||
fun generateHtml(text: String): String = createHTML(prettyPrint = false).h1 { text(text) }.toString() | ||
|
||
fun main(args: Array<String>) = Foo().main(args) |
18 changes: 9 additions & 9 deletions
18
example/kotlinlib/basic/1-simple/foo/test/src/foo/FooTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
package foo | ||
|
||
import foo.generateHtml | ||
import io.kotest.core.spec.style.FunSpec | ||
import io.kotest.matchers.shouldBe | ||
|
||
class FooTest : FunSpec({ | ||
test("testSimple") { | ||
generateHtml("hello") shouldBe "<h1>hello</h1>" | ||
} | ||
class FooTest : | ||
FunSpec({ | ||
test("testSimple") { | ||
generateHtml("hello") shouldBe "<h1>hello</h1>" | ||
} | ||
|
||
test("testEscaping") { | ||
generateHtml("<hello>") shouldBe "<h1><hello></h1>" | ||
} | ||
}) | ||
test("testEscaping") { | ||
generateHtml("<hello>") shouldBe "<h1><hello></h1>" | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 8 additions & 8 deletions
16
example/kotlinlib/basic/2-custom-build-logic/foo/test/src/foo/FooTests.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
package foo | ||
|
||
import foo.getLineCount | ||
import io.kotest.core.spec.style.FunSpec | ||
import io.kotest.matchers.shouldBe | ||
|
||
class FooTests : FunSpec({ | ||
class FooTests : | ||
FunSpec({ | ||
|
||
test("testSimple") { | ||
val expectedLineCount = 12 | ||
val actualLineCount = getLineCount()?.trim().let { Integer.parseInt(it) } | ||
actualLineCount shouldBe expectedLineCount | ||
} | ||
}) | ||
test("testSimple") { | ||
val expectedLineCount = 12 | ||
val actualLineCount = getLineCount()?.trim().let { Integer.parseInt(it) } | ||
actualLineCount shouldBe expectedLineCount | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 11 additions & 11 deletions
22
example/kotlinlib/basic/3-multi-module/bar/test/src/bar/BarTests.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
package bar | ||
|
||
import bar.generateHtml | ||
import io.kotest.core.spec.style.FunSpec | ||
import io.kotest.matchers.shouldBe | ||
|
||
class BarTests : FunSpec({ | ||
class BarTests : | ||
FunSpec({ | ||
|
||
test("simple") { | ||
val result = generateHtml("hello") | ||
result shouldBe "<h1>hello</h1>" | ||
} | ||
test("simple") { | ||
val result = generateHtml("hello") | ||
result shouldBe "<h1>hello</h1>" | ||
} | ||
|
||
test("escaping") { | ||
val result = generateHtml("<hello>") | ||
result shouldBe "<h1><hello></h1>" | ||
} | ||
}) | ||
test("escaping") { | ||
val result = generateHtml("<hello>") | ||
result shouldBe "<h1><hello></h1>" | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 7 additions & 6 deletions
13
example/kotlinlib/dependencies/2-run-compile-deps/bar/src/bar/Bar.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 7 additions & 7 deletions
14
example/kotlinlib/dependencies/4-downloading-unmanaged-jars/src/foo/Foo.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
package foo | ||
|
||
class Bar { | ||
|
||
fun main() = println("Hello Bar") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
package foo | ||
|
||
class Foo { | ||
|
||
fun main() = println("Hello Foo") | ||
} |
Oops, something went wrong.