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
240
Capture Checking / Separation Checking 入門
tanishiking
0
730
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
1.9k
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
AI駆動開発における開発環境のセキュリティの考え方
yamahiro
0
200
DGX Spark でどこまでハッキングができるのか?
kash1064
3
1.4k
オントロジーって 結局なにもの? AI エージェントに「意味」を渡す知識設計の話
greenmidori
0
250
DevelopersIO 2026 Tokyo 現時点の衛星通信サービスの現状を整理してみる
maroon1st
0
110
古い指輪から広がった JAVA コミュニティ とのつながり
yamad
0
130
Turning Repos into the Product Second Brain with an LLM Wiki
linedevth
0
130
こんにちは!SORACOM です & IoT とは【SORACOM UG 東北 in 八戸】
soracom
PRO
0
160
生成AI時代、PMは事業責任者に進化するともっと面白い〜PMだからこそ事業構造を動かせる時代に〜
kakehashi
PRO
0
190
LambdaWebFunctionsを試してみた / exploring-lambda-web-functions
koukihosaka
1
380
Code for Security プロジェクト紹介 2026年10月
yu23ki14
0
120
AIにシークレットを見せない、WSL2で安全な開発環境
yazm
0
330
Active Record Connection Adaptersにおける長年の課題に再び取り組む
yahonda
0
400
Featured
See All Featured
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
Ethics towards AI in product and experience design
skipperchong
2
440
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
270
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
580
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
46k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
930
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.1k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
2
330
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
630
Git: the NoSQL Database
bkeepers
PRO
433
67k
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を使って簡単に独自ルールが
作れる