WartRemover is a flexible code linting tool for Scala.
It approaches linting through small checks known as warts, each targeting a language feature or programming pattern that a project may wish to prohibit. This makes it particularly suitable for teams that want to define a constrained subset of Scala rather than accept every construct permitted by the compiler. The supplied checks range from potentially unsafe behaviour to features that can weaken type safety or make code harder to reason about, while custom warts can extend the system with organisation-specific policies.
This is free and open source software.
Key Features
- Supplies individual warts that can be enabled selectively according to a project’s coding policy.
- Offers collections of checks for applying groups of restrictions without configuring every wart separately.
- Can reject explicit use of
nulland other constructs that undermine Scala’s type-safety guarantees. - Detects unsafe access to partial APIs such as retrieving a value directly from an empty
Option. - Can flag inferred
Nothingtypes where inference may indicate that important type information is missing. - Includes checks for unsafe casts, non-exhaustive programming practices and other potentially surprising language usage.
- Supports exclusions so selected source regions, declarations or generated code do not need to satisfy every rule.
- Allows developers to create custom warts using the Scala compiler tree API.
- Operates as a compiler plugin, placing checks directly in the normal Scala compilation process.
- Can fail compilation when prohibited patterns are encountered, making coding rules enforceable rather than advisory.
- Supports Scala projects built with commonly used Scala build tooling.
- Provides separate rule implementations for language constructs so teams can adopt restrictions incrementally.
Website: github.com/wartremover/wartremover
Support:
Developer: Brian McKenna, Chris Neveu and contributors
License: Apache License 2.0
WartRemover is written in Scala. Learn Scala with our recommended free books and free tutorials.
Related Software
| Scala Linters | |
|---|---|
| Scalafix | Refactoring and static analysis tool for improving code quality |
| Scapegoat | Static analysis tool that detects bugs and questionable code |
| WartRemover | Flexible tool for enforcing safer coding practices |
Read our verdict in the software roundup.
Explore our carefully curated directory of recommended free and open source software, covering every major software category.The directory forms part of our extensive collection of articles for Linux enthusiasts. It includes hundreds of detailed reviews, together with free and open source alternatives to proprietary software from companies such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk. LinuxLinks also covers interesting projects worth exploring, Linux-compatible hardware, free programming books and tutorials, and much more. Know a useful free and open source Linux application that we haven’t covered? Tell us about it using our submission form. |


Please read our Comment Policy before commenting.