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
Rikito Taniguchi
January 19, 2019
Technology
1
240
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
290
Implementing and Evaluating a High-Level Language with WasmGC and the Wasm Component Model: Scala’s Case
tanishiking
0
370
Scala meets WebAssembly
tanishiking
0
810
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
92
Tooling for Scala3
tanishiking
0
420
API-Based Code Search
tanishiking
0
81
Other Decks in Technology
See All in Technology
AIBuildersDay_track_A_iidaxs
iidaxs
4
1.6k
2025-12-27 Claude CodeでPRレビュー対応を効率化する@機械学習社会実装勉強会第54回
nakamasato
4
1.3k
フィッシュボウルのやり方 / How to do a fishbowl
pauli
2
430
普段使ってるClaude Skillsの紹介(by Notebooklm)
zerebom
8
2.6k
ECS_EKS以外の選択肢_ROSA入門_.pdf
masakiokuda
1
120
日本の AI 開発と世界の潮流 / GenAI Development in Japan
hariby
2
700
Entity Framework Core におけるIN句クエリ最適化について
htkym
0
140
Redshift認可、アップデートでどう変わった?
handy
1
110
まだ間に合う! Agentic AI on AWSの現在地をやさしく一挙おさらい
minorun365
19
3.3k
Oracle Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
2
510
202512_AIoT.pdf
iotcomjpadmin
0
160
[Data & AI Summit '25 Fall] AIでデータ活用を進化させる!Google Cloudで作るデータ活用の未来
kirimaru
0
4.1k
Featured
See All Featured
How to Think Like a Performance Engineer
csswizardry
28
2.4k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
210
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
130
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1k
Claude Code のすすめ
schroneko
67
210k
Context Engineering - Making Every Token Count
addyosmani
9
570
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.4k
Git: the NoSQL Database
bkeepers
PRO
432
66k
For a Future-Friendly Web
brad_frost
180
10k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.1k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
2.8k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
0
100
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を使って簡単に独自ルールが
作れる