Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Scala-Matsuri-2023.pdf
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
kenji yoshida
April 16, 2023
Programming
0
1.6k
Scala-Matsuri-2023.pdf
kenji yoshida
April 16, 2023
Tweet
Share
More Decks by kenji yoshida
See All by kenji yoshida
sbt 2
xuwei_k
0
360
数十万行のプロジェクトを Scala 2から3に完全移行した
xuwei_k
0
1.5k
Scalaプロジェクトの ビルド速度改善
xuwei_k
0
510
WartremoverのScala 3対応
xuwei_k
0
200
アルプでのScala 3移⾏
xuwei_k
1
1.7k
ScalaでgRPC
xuwei_k
0
1.7k
scalaprops
xuwei_k
0
150
Other Decks in Programming
See All in Programming
Rで始めるML・LLM活用入門
wakamatsu_takumu
0
130
NOT A HOTEL - 建築や人と融合し、自由を創り出すソフトウェア
not_a_hokuts
2
490
CSC307 Lecture 11
javiergs
PRO
0
580
TROCCOで実現するkintone+BigQueryによるオペレーション改善
ssxota
0
110
AIエージェントのキホンから学ぶ「エージェンティックコーディング」実践入門
masahiro_nishimi
7
1.2k
CSC307 Lecture 09
javiergs
PRO
1
850
コーディングルールの鮮度を保ちたい / keep-fresh-go-internal-conventions
handlename
0
120
New in Go 1.26 Implementing go fix in product development
sunecosuri
0
100
AIによる開発の民主化を支える コンテキスト管理のこれまでとこれから
mulyu
3
2.2k
AI駆動開発の本音 〜Claude Code並列開発で見えたエンジニアの新しい役割〜
hisuzuya
4
440
Swift ConcurrencyでよりSwiftyに
yuukiw00w
0
220
go directiveを最新にしすぎないで欲しい話──あるいは、Go 1.26からgo mod initで作られるgo directiveの値が変わる話 / Go 1.26 リリースパーティ
arthur1
2
410
Featured
See All Featured
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
140
Chasing Engaging Ingredients in Design
codingconduct
0
130
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.2k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
63
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
220
We Have a Design System, Now What?
morganepeng
55
8k
Technical Leadership for Architectural Decision Making
baasie
2
270
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.1k
Documentation Writing (for coders)
carmenintech
77
5.3k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
130
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
200
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.1k
Transcript
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