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
Quick introduction to scalafix
Search
Rikito Taniguchi
January 19, 2019
Technology
280
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Quick introduction to scalafix
Scala fukuoka 2019 LT
Rikito Taniguchi
January 19, 2019
More Decks by Rikito Taniguchi
See All by Rikito Taniguchi
GC言語のWasm化とComponent Modelサポートの実践と課題 - Scalaの場合
tanishiking
0
250
Capture Checking / Separation Checking 入門
tanishiking
0
750
Implementing and Evaluating a High-Level Language with WasmGC and the Wasm Component Model: Scala’s Case
tanishiking
0
840
Scala meets WebAssembly
tanishiking
0
1.1k
Why Wasm+WASI for Scala
tanishiking
0
160
Scala to WebAssembly: Exploring the How and Why
tanishiking
1
2k
Scala to WebAssembly #scala_waiwai
tanishiking
0
2k
Scala Days Madrid 2023 参加レポート
tanishiking
0
120
Tooling for Scala3
tanishiking
0
460
Other Decks in Technology
See All in Technology
Oracle Database Security 詳細解説
oracle4engineer
PRO
1
180
今から始めるAWS環境の暗号移行 - ポスト量子時代に備える
sato4mi
0
130
AI時代のエンジニアの情報発信〜個人の発信を組織の力に変える〜
ryo_kawamata
0
5.6k
[General] 개발자로 해외 기업에서 일하기
skydoves
1
150
Devin プロモコードの受け取りと適用(2026.10.27)
kinopeee
1
760
デザインレビューは自動化できるのか?─ Flutter × Figma で UI 品質保証を考える
techiro
2
670
Don't write the architecture only in the prompt.
neohsu
0
280
新米を「売り越さない」、Aurora DSQLで作る在庫ゼロ死守の限定ドロップEC
yama3133
0
120
「作れる」と「リリースできる」の間にあったもの── PdMを外して見えた、PdMがやるべき仕事/Buildable ≠ Shippable: What Removing the PM Taught Me About the PM’s Job
yappli_developers
0
390
AIがGISを代替する日:〜すべてをAIが創る時代に、私たちがFOSS4Gに関わる意味〜
lehupa
0
140
なぜAI時代に技術記事を書くのか?どう書くのか? 〜bunの場合〜
kworkdev
PRO
0
1.3k
外国人エンジニアがVueプロトタイプで仕様を合わせている話 / Vue Fes Japan 2026 LT
eluwing
0
330
Featured
See All Featured
エンジニアに許された特別な時間の終わり
watany
109
250k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
2.9k
Prompt Engineering for Job Search
mfonobong
0
570
Designing Experiences People Love
moore
143
24k
Producing Creativity
orderedlist
PRO
348
41k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
4
1.2k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.7k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Scaling GitHub
holman
464
140k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Building Better People: How to give real-time feedback that sticks.
wjessup
371
20k
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を使って簡単に独自ルールが
作れる