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
270
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
180
Capture Checking / Separation Checking 入門
tanishiking
0
600
Implementing and Evaluating a High-Level Language with WasmGC and the Wasm Component Model: Scala’s Case
tanishiking
0
750
Scala meets WebAssembly
tanishiking
0
1k
Why Wasm+WASI for Scala
tanishiking
0
140
Scala to WebAssembly: Exploring the How and Why
tanishiking
1
1.9k
Scala to WebAssembly #scala_waiwai
tanishiking
0
1.9k
Scala Days Madrid 2023 参加レポート
tanishiking
0
110
Tooling for Scala3
tanishiking
0
450
Other Decks in Technology
See All in Technology
AI 不只幫你寫 Code: 當專案從 300 暴增到 1500, 我們如何撐住 DevOps
appleboy
0
220
從開發到部署全都交給 AI:實作 AI 驅動的自動化流程
appleboy
0
160
[AWS Summit Japan 2026]迷っているあなたへ_小さな一歩が、やがて自分を助けてくれる
sh_fk2
2
400
あなたの知らないPDFのアクセシビリティ
lycorptech_jp
PRO
0
240
Zenoh on Zephyr on LiteX
takasehideki
2
110
WebGIS AI Agentの紹介
_shimizu
0
550
iOS アプリの「これって不具合ですか?」を AI に調べてもらう
miichan
0
140
事業会社における 機械学習・推薦システム技術の活用事例と必要な能力 / ml-recsys-in-layerx-wantedly-2026
yuya4
0
160
When Platform Engineering Meets GenAI
sucitw
0
170
技術・能力を向上する原理原則 #きのこセッションa #きのこ2026
bash0c7
0
120
新しいUbuntu/GNOMEが使いたいからXからWaylandへ移行頑張ってるの巻 2026-06-20
nobutomurata
0
160
BPaaSで進むAIオペレーションの現在地 AI実装が効く領域とスケーラビリティの選定と実装
kentarofujii
0
150
Featured
See All Featured
Building an army of robots
kneath
306
46k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
1.8k
GitHub's CSS Performance
jonrohan
1033
470k
[SF Ruby Conf 2025] Rails X
palkan
2
1.1k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
470
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
610
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
780
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
210
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
160
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
410
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を使って簡単に独自ルールが
作れる