Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥

KotlinのLinterまなびなおし2024のホコウ

 KotlinのLinterまなびなおし2024のホコウ

nyafunta9858

July 08, 2024
Tweet

More Decks by nyafunta9858

Other Decks in Programming

Transcript

  1. ⼩林 慶弘 (Yoshihiro Kobayashi) a.k.a nyafunta9858 • Android Engineer @

    Yappli, Inc. • 趣味:ガジェット集め、ゲーム、カメラ... • 最近:ずっとかき氷⾷べてる
  2. Konsistとは? • Architectural Checks / Declarative Checks • ユニットテスト環境で実⾏ ◦

    JUnit4、JUnit5、Kotestなどのテスティングフレームワーク上で実⾏可能 • 標準ルールセットはなし
  3. Konsistとは? • Architectural Checks / Declarative Checks • ユニットテスト環境で実⾏ ◦

    JUnit4、JUnit5、Kotestなどのテスティングフレームワーク上で実⾏可能 • 標準ルールセットはなし
  4. セットアップ -モジュール間の参照- :app ├AaaTest.kt ├BbbTest.kt └KonsistTest.kt :feature1 ├CccTest.kt ├DddTest.kt └KonsistTest.kt

    :featureN ├YyyTest.kt ├ZzzTest.kt └KonsistTest.kt ︙ implementation implementation implementation
  5. Isolate Konsist Tests Typically, it's advisable to consolidate all Konsist

    tests in a unified location. This approach is preferred because these tests are often designed to validate the structure of the entire project's codebase. There are three potential options for storing Konsist tests: https://docs.konsist.lemonappdev.com/
  6. Isolate Konsist Tests :app ├AaaTest.kt ├BbbTest.kt └KonsistTest.kt :feature1 ├CccTest.kt ├DddTest.kt

    └KonsistTest.kt :featureN ├YyyTest.kt ├ZzzTest.kt └KonsistTest.kt ︙ implementation implementation implementation
  7. Isolate Konsist Tests :app ├AaaTest.kt ├BbbTest.kt └KonsistTest.kt :feature1 ├CccTest.kt ├DddTest.kt

    └KonsistTest.kt :featureN ├YyyTest.kt ├ZzzTest.kt └KonsistTest.kt :konsistTest ︙ implementation implementation implementation implementation
  8. Isolate Konsist Tests :app ├AaaTest.kt ├BbbTest.kt └KonsistTest.kt :feature1 ├CccTest.kt ├DddTest.kt

    └KonsistTest.kt :featureN ├YyyTest.kt ├ZzzTest.kt └KonsistTest.kt :konsistTest ︙ implementation implementation implementation implementation
  9. Isolate Konsist Tests implementation implementation implementation implementation :konsistTest └KonsistTest.kt :app

    ├AaaTest.kt └BbbTest.kt :feature1 ├CccTest.kt └DddTest.kt :featureN ├YyyTest.kt └ZzzTest.kt ︙
  10. Isolate Konsist Tests implementation implementation implementation implementation :app ├AaaTest.kt └BbbTest.kt

    :feature1 ├CccTest.kt └DddTest.kt :featureN ├YyyTest.kt └ZzzTest.kt ︙ :konsistTest └KonsistTest.kt
  11. Isolate Konsist Tests :app ├AaaTest.kt └BbbTest.kt :feature1 ├CccTest.kt └DddTest.kt :featureN

    ├YyyTest.kt └ZzzTest.kt :konsistTest └KonsistTest.kt ︙ implementation
  12. Isolate Konsist Tests :app ├AaaTest.kt └BbbTest.kt :feature1 ├CccTest.kt └DddTest.kt :featureN

    ├YyyTest.kt └ZzzTest.kt :konsistTest └KonsistTest.kt ︙ implementation Konsistのテストを分離できた👍
  13. Konsistの仕組み Konsist on the other hand imports Kotlin code directly

    by reading and parsing Kotlin (text) files: This means that it is compatible regardless of the Kotlin Multiplatform compilation targets: https://proandroiddev.com/archunit-vs-konsist-why-did-we-need-another-linter-972c4ff2622d
  14. Konsistの仕組み Konsist on the other hand imports Kotlin code directly

    by reading and parsing Kotlin (text) files: This means that it is compatible regardless of the Kotlin Multiplatform compilation targets: https://proandroiddev.com/archunit-vs-konsist-why-did-we-need-another-linter-972c4ff2622d