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
Quick introduction to scalafix
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Rikito Taniguchi
January 19, 2019
Technology
1
250
Quick introduction to scalafix
Scala fukuoka 2019 LT
Rikito Taniguchi
January 19, 2019
Tweet
Share
More Decks by Rikito Taniguchi
See All by Rikito Taniguchi
Capture Checking / Separation Checking 入門
tanishiking
0
470
Implementing and Evaluating a High-Level Language with WasmGC and the Wasm Component Model: Scala’s Case
tanishiking
0
590
Scala meets WebAssembly
tanishiking
0
880
Why Wasm+WASI for Scala
tanishiking
0
130
Scala to WebAssembly: Exploring the How and Why
tanishiking
1
1.8k
Scala to WebAssembly #scala_waiwai
tanishiking
0
1.8k
Scala Days Madrid 2023 参加レポート
tanishiking
0
95
Tooling for Scala3
tanishiking
0
420
API-Based Code Search
tanishiking
0
92
Other Decks in Technology
See All in Technology
EMからICへ、二周目人材としてAI全振りのプロダクト開発で見つけた武器
yug1224
3
220
生成AI活用によるPRレビュー改善の歩み
lycorptech_jp
PRO
5
2k
自動テストが巻き起こした開発プロセス・チームの変化 / Impact of Automated Testing on Development Cycles and Team Dynamics
codmoninc
1
980
ヘルシーSRE
tk3fftk
2
230
型を書かないRuby開発への挑戦
riseshia
0
160
大規模サービスにおける レガシーコードからReactへの移行
magicpod
1
120
Contract One Engineering Unit 紹介資料
sansan33
PRO
0
14k
AIに視覚を与えモバイルアプリケーション開発をより円滑に行う
lycorptech_jp
PRO
1
780
Data Hubグループ 紹介資料
sansan33
PRO
0
2.8k
バクラクのSREにおけるAgentic AIへの挑戦/Our Journey with Agentic AI
taddy_919
2
980
JAWS DAYS 2026 CDP道場 事前説明会 / JAWS DAYS 2026 CDP Dojo briefing document
naospon
0
120
Oracle Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
4
1.6k
Featured
See All Featured
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
0
2.4k
Reality Check: Gamification 10 Years Later
codingconduct
0
2k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
220
Fireside Chat
paigeccino
42
3.8k
It's Worth the Effort
3n
188
29k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
140
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
280
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
60
42k
So, you think you're a good person
axbom
PRO
2
1.9k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
470
The agentic SEO stack - context over prompts
schlessera
0
680
The Spectacular Lies of Maps
axbom
PRO
1
580
Transcript
Quick introduction to scalafix Scala福岡 2019
About me - 谷口 力斗 / @tanishiking - 株式会社はてな -
Scala / TypeScript / Go / Perl - 高校生までは福岡に住んでました
Scalafix - https://scalacenter.github.io/scalafix/ - Refactoring and linting tool for Scala
- scala.meta - Builtin Rules / Suppressing Rules - Linter - 独自ルールを作ろう
Scala.meta
Scala.meta - https://scalameta.org/ - Scala compiler とは独立した Scala プログラム 解析のためのライブラリ
- Syntactic API - Semantic API
Scala.meta - Syntactic API - Scalaプログラムをパースしトークン列や構文木 を返すAPI println("function(argument)".parse[Stat].get.struct ure) //
Term.Apply(Term.Name("function"), List(Term.Name("argument")))
Scala.meta - Semantic API - 型情報やシンボルの情報を提供するAPI - compiler plugin を使って
typer phase の後に SemanticDB を生成 - SemanticDB - protobuf で定められたスキーマに従ってシリ アライズされたバイナリ
Builtin Rules / Supressing Rules
Builtin Rules - https://scalacenter.github.io/scalafix/docs/rul es/overview.html // .scalafix.conf rules = [
DisableSyntax, RemoveUnused ]
Suppressing Rules @SuppressWarnings(Array("all")) def foo = ??? List("", null) //
scalafix: ok // scalafix: off foo(null) // scalafix: on
Linter
Linter - v0.5 から linter としての機能が豊富に - 将来的に metals (scala.meta
ベースの Language Server 実装) から scalafix を使った refactoring や lint の提供も
Lint (vs wartremover) - (+) Lintに加えて自動修正もできる - (+) syntactic rulesの実行にコンパイルは不要
なので高速 - (+) 独自ルールの実装が容易(wart実装も難しくないけど) - (-) Builtin rule が少ない - (-) scala compiler と比べて SemanticDB から取 得できる情報は制限される
独自ルールを 作ろう
独自ルールを作ろう https://scalacenter.git hub.io/scalafix/docs/d evelopers/setup.html
独自ルールを作ろう - 作ってみた https://github.com/tanishiking/scalafix-check-scaladoc - publicなAPIにscaladocが書かれてなかったら 怒ってくれるルール - golintとかにあるやつ
まとめ - scalafix は refactoring ツールとしてだけでなく linter としても使える - scala.metaのAPIを使って簡単に独自ルールが
作れる