Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Scala-Matsuri-2023.pdf
Search
kenji yoshida
April 16, 2023
Programming
1.6k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Scala-Matsuri-2023.pdf
kenji yoshida
April 16, 2023
Transcript
16 slides
Scalafix and Wartremover 2023 ScalaMatsuri 2023 2023-04-16 1 / 16
twitter @xuwei_k github @xuwei-k blog https://xuwei-k.hatenablog.com 2 / 16
2020: Scalafix やWartremover の独自ルール を仕事で活用する 2022: Wartremover のScala 3 対応
3 / 16
wartremover Compiler plugin Linter TASTy inspector でcompile 時とは別に動か す方法増やした 原理上、全ての型情報を扱えるので、何でも正確
に判断できる ここ数年ほとんど@xuwei-k しかコミットしてな い 4 / 16
wartremover Scala 2 と3 で全く別のコードを書く必要がある デメリット SemanticDB の生成が遅いので、それを考慮する とSemanticRule よりwartremover
の方が実行 速い? 型情報扱わないなら使うべきではない 言い換えるとscalafix のSyntacticRule で良いなら必要な い 5 / 16
残してあるがscalafix の SyntacticRule で十分な例 AsInstanceOf, IsInstanceOf, Throw, Var, While, Return,
Null, ExplicitImplicitTypes, DefaultArguments 6 / 16
scalafix SyntacticRule とSemanticRule で実行できる ことや、実行速度が異なる @xuwei-k はscalafix 自体のコミッターではな い 稀にpull
req する程度 自作でOSS のrule 多数公開してる この発表の2023-04-16 時点で75 個 https://github.com/xuwei-k/scalafix-rules 7 / 16
scalafix Linter にもなるし、書き換えも出来る SyntacticRule はとても速い rule 実行するたびにcompile やり直さなくてよ い wartremover
でもScala 3 なら同様 8 / 16
近況 本当に毎日のレベルで仕事かOSS でscalafix 書 いてる( 今までの合計数百) scalafix とwartremover それぞれ長所も短所 あるので両方使ってる
9 / 16
近況 wartremover のScala 3 対応はほぼ終わった wartremover もscalafix も独自rule 色々足し た
scala-js でscalafix 作るためのサイト作った ことにより大幅にscalafix 書きやすくなった 10 / 16
https://xuwei-k.github.io/scalameta-ast/ 日本語blog Scala コードを入力すると、scala-js と scalameta で変換の後のAST 表示してくれる かなり細かく機能つけた 11
/ 16
https://xuwei-k.github.io/scalameta-ast/ dialect 選択 SyntacticRule 、SemanticRule の雛形生成 Rule の雛形においての細かい設定 package 、rule
名、import style 12 / 16
https://xuwei-k.github.io/scalameta-ast/ input とoutput 両方をscalafmt でformat js で動かすためにscalafmt 独自fork していて面倒 scalafmt
の設定も自由に可能 browser のlocal strage に前回の状態保存 scalameta のversion 選択可能 13 / 16
wartremover の近況 wartremover のsbt plugin にscalafix のよ うなinput task 追加した
Scala 3 で独自にunion type のleast upper bound を計算する仕組みを作った 14 / 16
Live Coding や 既存のrule 説明 15 / 16
おわり 16 / 16
More Decks by kenji yoshida
See All by kenji yoshida
sbt 2
xuwei_k
0
540
数十万行のプロジェクトを Scala 2から3に完全移行した
xuwei_k
0
1.6k
Scalaプロジェクトの ビルド速度改善
xuwei_k
0
610
WartremoverのScala 3対応
xuwei_k
0
210
アルプでのScala 3移⾏
xuwei_k
1
1.8k
ScalaでgRPC
xuwei_k
0
1.8k
scalaprops
xuwei_k
0
170
Other Decks in Programming
See All in Programming
GraphQL の onError と Nullability のこれから
quramy
0
220
Goコンパイラを作ってGoをもっと理解する / Build a Go compiler to better understand Go
ikura_hamu
0
130
AIが生成したコードは読むべきか?抽象化設計とコードの品質保証 / abstraction-design-and-quality
minodriven
16
9.4k
SFCで実現する病院・医療システムの動的組み立て式UI
koukimiura
1
180
Secure Your Coding Agent Like It’s Malware (v1.5) 🇬🇧 @Code.talks 2026
richargh
0
190
まずはコードより業務と向き合う:テーブル解体のためにPdMを呼んだ話
sakawe_ee
0
250
クラウドエージェントは、 何がそんなに便利なのか / what makes cloud agents so useful
rkaga
5
940
flutter_test のその先へ — Flutter アプリの LLM 機能に「評価」という品質保証を
kosukesaigusa
0
210
LLM 101: Exploring LLMs, Starting with Tokens.
dalinaum
0
120
[Kotlin Fest 2026] eBPF Tracing for Kotlin
takehaya
1
380
React Native에 현대적인 빌드 도구 더하기: Rollipop 구현기
leegeunhyeok
0
190
TanStack Vue Query と Pinia Colada から学ぶ非同期状態の型設計
aoshi
0
690
Featured
See All Featured
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
630
Deep Space Network (abreviated)
tonyrice
0
420
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
480
The Cost Of JavaScript in 2023
addyosmani
56
10k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.2k
Building Better People: How to give real-time feedback that sticks.
wjessup
371
20k
A Modern Web Designer's Workflow
chriscoyier
699
190k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.3k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
470
Technical Leadership for Architectural Decision Making
baasie
4
650
[SF Ruby Conf 2025] Rails X
palkan
3
1.5k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k