SlideShare a Scribd company logo
Scala
Iulian Dragos
Overview
• Static checker tool
• Based on type-checked ASTs
• Easy to use and write rules
Goals
• Unify existing approaches in one platform
• Easy to write rules
• Easy to use other people’s rules
• Reasonable performance
• Good integrations
Abide
• Rules are decoupled from the tool
• rule packages
• project-specific rules
• Integrates with Sbt
• planned: Maven, Eclipse
Examples
• Core package
• Unused members
• Vars that are never re-assigned
• Renamed arguments with defaults
• Akka
• sender method called inside future
Architecture
Abide
abide-plugin
scalac
core rules
extra rules
project-specific
...
Use
addSbtPlugin("com.typesafe" % "sbt-abide" % "0.1.0")
libraryDependencies += "com.typesafe" %% "abide-core" % “0.1.0” % "abide"
libraryDependencies += "com.typesafe" %% "abide-extra" % “0.1.0” % "abide"
Project(...).dependsOn(rules % "abide")
Anatomy
Traversers
• Fused: one-pass for all rules
• Optimised: rules are filtered on what they match
Directives
• Shared context between rules
• compiler universe
• user-defined mix-ins
Rules
val step = {
case varDef @ q"$mods var $name : $tpt = $value" =>
nok(varDef.symbol, Warning(varDef))
case q"$rcv = $expr" =>
ok(rcv.symbol)
}
quasi-quote
state helpers
Replace `var` with `val`
Rules
• partial function Tree => Unit
• collect keys that can do one transition
• nok (not ok)
• ok (stable state)
Rules
• existential rules (what we’ve seen)
• scoping rules
• helpers to maintain nesting
• enter (no need for removing, handled by the library)
• path rules
• like scoping, but richer state checks
Coding a rule
For example..
Mutation inside iteration
• Let’s forbid mutating the underlying collection while
iterating
for (x <- xs)
xs -= x xs map { x => xs -= x }
ys foreach { case (k, v) =>
ys remove 1
}
for (p <- icodes; x <- xs) {
icodes -= p._1
xs remove x
}
Simplifying assumptions
• purely syntactical matching (no points-to analysis)
• name-based
xs map { x => xs -= x }
Let’s code
Future
Next
• SupressWarning support
• Integrations: maven and IDEs
• More rules
Contribute!
• The value is in rules
• Contribute to scala/scala-abide
• ..or write your own rule package
Acknowledgements
Nicolas Voirol (@samarion) did all the work during
his internship at Typesafe Switzerland
Thank you

More Related Content

PPTX
SQL Provider
Ross McKinlay
 
PPTX
Search and analyze your data with elasticsearch
Anton Udovychenko
 
PPTX
Scala elegant and exotic part 1
VulcanMinds
 
PDF
Scala.js - yet another what..?
Artur Skowroński
 
PPTX
Scala.js for large and complex frontend apps
Otto Chrons
 
PDF
libAttachSQL, The Next-Generation C Connector For MySQL
Andrew Hutchings
 
PPTX
Elasticsearch Arcihtecture & What's New in Version 5
Burak TUNGUT
 
PPTX
Slick – the modern way to access your Data
Jochen Huelss
 
SQL Provider
Ross McKinlay
 
Search and analyze your data with elasticsearch
Anton Udovychenko
 
Scala elegant and exotic part 1
VulcanMinds
 
Scala.js - yet another what..?
Artur Skowroński
 
Scala.js for large and complex frontend apps
Otto Chrons
 
libAttachSQL, The Next-Generation C Connector For MySQL
Andrew Hutchings
 
Elasticsearch Arcihtecture & What's New in Version 5
Burak TUNGUT
 
Slick – the modern way to access your Data
Jochen Huelss
 

What's hot (20)

PPTX
ElasticSearch for data mining
William Simms
 
PDF
HandlerSocket
Łukasz Barulski
 
ODP
Introduction to Scala JS
Knoldus Inc.
 
PPTX
Dev nexus 2017
Roy Russo
 
PPTX
ELK - Stack - Munich .net UG
Steve Behrendt
 
PPTX
Devnexus 2018
Roy Russo
 
PPTX
BigData, NoSQL & ElasticSearch
Sanura Hettiarachchi
 
ODP
Elastic search
NexThoughts Technologies
 
PDF
Interactive learning analytics dashboards with ELK (Elasticsearch Logstash Ki...
Andrii Vozniuk
 
PPTX
Spark real world use cases and optimizations
Gal Marder
 
PPSX
Contributing code to cassandra
odpeer
 
PDF
Elastic Search
Lukas Vlcek
 
PDF
Elasticsearch and Spark
Audible, Inc.
 
PPTX
Elasticsearch { "Meetup" : "talk" }
Lutf Ur Rehman
 
PPTX
Alberto Paro - Hands on Scala.js
Scala Italy
 
PPTX
Introduction to ELK
YuHsuan Chen
 
PPTX
Intro to elasticsearch
Joey Wen
 
PPTX
MongoDB
Rony Gregory
 
PPTX
Real Time search using Spark and Elasticsearch
Sigmoid
 
PDF
Scaling SolrCloud to a Large Number of Collections: Presented by Shalin Shekh...
Lucidworks
 
ElasticSearch for data mining
William Simms
 
HandlerSocket
Łukasz Barulski
 
Introduction to Scala JS
Knoldus Inc.
 
Dev nexus 2017
Roy Russo
 
ELK - Stack - Munich .net UG
Steve Behrendt
 
Devnexus 2018
Roy Russo
 
BigData, NoSQL & ElasticSearch
Sanura Hettiarachchi
 
Elastic search
NexThoughts Technologies
 
Interactive learning analytics dashboards with ELK (Elasticsearch Logstash Ki...
Andrii Vozniuk
 
Spark real world use cases and optimizations
Gal Marder
 
Contributing code to cassandra
odpeer
 
Elastic Search
Lukas Vlcek
 
Elasticsearch and Spark
Audible, Inc.
 
Elasticsearch { "Meetup" : "talk" }
Lutf Ur Rehman
 
Alberto Paro - Hands on Scala.js
Scala Italy
 
Introduction to ELK
YuHsuan Chen
 
Intro to elasticsearch
Joey Wen
 
MongoDB
Rony Gregory
 
Real Time search using Spark and Elasticsearch
Sigmoid
 
Scaling SolrCloud to a Large Number of Collections: Presented by Shalin Shekh...
Lucidworks
 
Ad

Viewers also liked (15)

PDF
Relational Databases are Evolving To Support New Data Capabilities
EDB
 
PDF
Your Code is Wrong
nathanmarz
 
PDF
Puppet at Google
Puppet
 
PPTX
Why Spark?
Álvaro Agea Herradón
 
PDF
IMCSummit 2015 - Day 2 IT Business Track - 4 Myths about In-Memory Databases ...
In-Memory Computing Summit
 
PDF
The Need for Async @ ScalaWorld
Konrad Malawski
 
PDF
Delivering Meaning In Near-Real Time At High Velocity In Massive Scale with A...
Helena Edelson
 
PPTX
Purely Functional Data Structures in Scala
Vladimir Kostyukov
 
PDF
Monadic Java
Mario Fusco
 
PDF
NewSQL overview, Feb 2015
Ivan Glushkov
 
PDF
The Newest in Session Types
Roland Kuhn
 
PPT
Scala Days San Francisco
Martin Odersky
 
PDF
Espresso: LinkedIn's Distributed Data Serving Platform (Paper)
Amy W. Tang
 
PDF
Functional Programming Patterns (BuildStuff '14)
Scott Wlaschin
 
PDF
Concurrency: The Good, The Bad and The Ugly
legendofklang
 
Relational Databases are Evolving To Support New Data Capabilities
EDB
 
Your Code is Wrong
nathanmarz
 
Puppet at Google
Puppet
 
IMCSummit 2015 - Day 2 IT Business Track - 4 Myths about In-Memory Databases ...
In-Memory Computing Summit
 
The Need for Async @ ScalaWorld
Konrad Malawski
 
Delivering Meaning In Near-Real Time At High Velocity In Massive Scale with A...
Helena Edelson
 
Purely Functional Data Structures in Scala
Vladimir Kostyukov
 
Monadic Java
Mario Fusco
 
NewSQL overview, Feb 2015
Ivan Glushkov
 
The Newest in Session Types
Roland Kuhn
 
Scala Days San Francisco
Martin Odersky
 
Espresso: LinkedIn's Distributed Data Serving Platform (Paper)
Amy W. Tang
 
Functional Programming Patterns (BuildStuff '14)
Scott Wlaschin
 
Concurrency: The Good, The Bad and The Ugly
legendofklang
 
Ad

Similar to Scala Abide: A lint tool for Scala (20)

PDF
Unsafe to typesafe
regisleray
 
PDF
Getting Started With Scala
Meetu Maltiar
 
PDF
Getting Started With Scala
Xebia IT Architects
 
PDF
Introducing Pattern Matching in Scala
Ayush Mishra
 
PDF
Scala jargon cheatsheet
Ruslan Shevchenko
 
PDF
Programming in scala - 1
Mukesh Kumar
 
PDF
Scala Paradigms
Tom Flaherty
 
PDF
The Scala Programming Language
league
 
PDF
Scala In The Wild
djspiewak
 
PDF
A Scala Corrections Library
Paul Phillips
 
PDF
scalaliftoff2009.pdf
Hiroshi Ono
 
PDF
scalaliftoff2009.pdf
Hiroshi Ono
 
PDF
scalaliftoff2009.pdf
Hiroshi Ono
 
PDF
scalaliftoff2009.pdf
Hiroshi Ono
 
ODP
Knolx Session : Built-In Control Structures in Scala
Ayush Mishra
 
PDF
A Brief Introduction to Scala for Java Developers
Miles Sabin
 
PDF
Miles Sabin Introduction To Scala For Java Developers
Skills Matter
 
KEY
Pontificating quantification
Aaron Bedra
 
PDF
Monads and Monoids by Oleksiy Dyagilev
JavaDayUA
 
PDF
Meet scala
Wojciech Pituła
 
Unsafe to typesafe
regisleray
 
Getting Started With Scala
Meetu Maltiar
 
Getting Started With Scala
Xebia IT Architects
 
Introducing Pattern Matching in Scala
Ayush Mishra
 
Scala jargon cheatsheet
Ruslan Shevchenko
 
Programming in scala - 1
Mukesh Kumar
 
Scala Paradigms
Tom Flaherty
 
The Scala Programming Language
league
 
Scala In The Wild
djspiewak
 
A Scala Corrections Library
Paul Phillips
 
scalaliftoff2009.pdf
Hiroshi Ono
 
scalaliftoff2009.pdf
Hiroshi Ono
 
scalaliftoff2009.pdf
Hiroshi Ono
 
scalaliftoff2009.pdf
Hiroshi Ono
 
Knolx Session : Built-In Control Structures in Scala
Ayush Mishra
 
A Brief Introduction to Scala for Java Developers
Miles Sabin
 
Miles Sabin Introduction To Scala For Java Developers
Skills Matter
 
Pontificating quantification
Aaron Bedra
 
Monads and Monoids by Oleksiy Dyagilev
JavaDayUA
 
Meet scala
Wojciech Pituła
 

Recently uploaded (20)

PDF
What to consider before purchasing Microsoft 365 Business Premium_PDF.pdf
Q-Advise
 
PPTX
AI-Ready Handoff: Auto-Summaries & Draft Emails from MQL to Slack in One Flow
bbedford2
 
DOCX
The Five Best AI Cover Tools in 2025.docx
aivoicelabofficial
 
PPTX
Web Testing.pptx528278vshbuqffqhhqiwnwuq
studylike474
 
PPTX
Why Use Open Source Reporting Tools for Business Intelligence.pptx
Varsha Nayak
 
PDF
On Software Engineers' Productivity - Beyond Misleading Metrics
Romén Rodríguez-Gil
 
PDF
Appium Automation Testing Tutorial PDF: Learn Mobile Testing in 7 Days
jamescantor38
 
PDF
Become an Agentblazer Champion Challenge
Dele Amefo
 
PDF
Community & News Update Q2 Meet Up 2025
VictoriaMetrics
 
PDF
Jenkins: An open-source automation server powering CI/CD Automation
SaikatBasu37
 
PPTX
ConcordeApp: Engineering Global Impact & Unlocking Billions in Event ROI with AI
chastechaste14
 
PPTX
oapresentation.pptx
mehatdhavalrajubhai
 
PPTX
Role Of Python In Programing Language.pptx
jaykoshti048
 
PPT
Order to Cash Lifecycle Overview R12 .ppt
nbvreddy229
 
PDF
Wondershare Filmora 14.5.20.12999 Crack Full New Version 2025
gsgssg2211
 
PDF
IEEE-CS Tech Predictions, SWEBOK and Quantum Software: Towards Q-SWEBOK
Hironori Washizaki
 
PDF
The Role of Automation and AI in EHS Management for Data Centers.pdf
TECH EHS Solution
 
PDF
Micromaid: A simple Mermaid-like chart generator for Pharo
ESUG
 
PDF
QAware_Mario-Leander_Reimer_Architecting and Building a K8s-based AI Platform...
QAware GmbH
 
PPTX
Explanation about Structures in C language.pptx
Veeral Rathod
 
What to consider before purchasing Microsoft 365 Business Premium_PDF.pdf
Q-Advise
 
AI-Ready Handoff: Auto-Summaries & Draft Emails from MQL to Slack in One Flow
bbedford2
 
The Five Best AI Cover Tools in 2025.docx
aivoicelabofficial
 
Web Testing.pptx528278vshbuqffqhhqiwnwuq
studylike474
 
Why Use Open Source Reporting Tools for Business Intelligence.pptx
Varsha Nayak
 
On Software Engineers' Productivity - Beyond Misleading Metrics
Romén Rodríguez-Gil
 
Appium Automation Testing Tutorial PDF: Learn Mobile Testing in 7 Days
jamescantor38
 
Become an Agentblazer Champion Challenge
Dele Amefo
 
Community & News Update Q2 Meet Up 2025
VictoriaMetrics
 
Jenkins: An open-source automation server powering CI/CD Automation
SaikatBasu37
 
ConcordeApp: Engineering Global Impact & Unlocking Billions in Event ROI with AI
chastechaste14
 
oapresentation.pptx
mehatdhavalrajubhai
 
Role Of Python In Programing Language.pptx
jaykoshti048
 
Order to Cash Lifecycle Overview R12 .ppt
nbvreddy229
 
Wondershare Filmora 14.5.20.12999 Crack Full New Version 2025
gsgssg2211
 
IEEE-CS Tech Predictions, SWEBOK and Quantum Software: Towards Q-SWEBOK
Hironori Washizaki
 
The Role of Automation and AI in EHS Management for Data Centers.pdf
TECH EHS Solution
 
Micromaid: A simple Mermaid-like chart generator for Pharo
ESUG
 
QAware_Mario-Leander_Reimer_Architecting and Building a K8s-based AI Platform...
QAware GmbH
 
Explanation about Structures in C language.pptx
Veeral Rathod
 

Scala Abide: A lint tool for Scala