Scala compiler plugin for static code analysis
Scala Java
Clone or download
Pull request Compare This branch is 11 commits ahead, 155 commits behind sksamuel:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
project
src
.gitignore
.travis.yml
LICENSE
README.md
build.sbt
lickitung.png
screenshot1.png

README.md

Lickitung

Build Status

lickitung

Lickitung is fork from Scapegoat, enhance the static analyze tool.

Scapegoat is a Scala static code analyzer, what is more colloquially known as a code lint tool or linter. Scapegoat works in a similar vein to Java's FindBugs or checkstyle, or Scala's Scalastyle.

A static code analyzer is a tool that flag suspicious language usage in code. This can include behavior likely to lead or bugs, non idiomatic usage of a language, or just code that doesn't conform to specified style guidelines.

Usage

  • Scala: 2.11.7
  • sbt: 0.13.9

Lickitung is fork from Scapegoat 0.94.0.

Lickitung is developed as a scala compiler plugin, which can then be used inside your build tool.

Reports

Here is sample output from the console during the build for a project with warnings/errors:

[warning] [scapegoat] Unused method parameter - org.ensime.util.ClassIterator.scala:46
[warning] [scapegoat] Unused method parameter - org.ensime.util.ClassIterator.scala:137
[warning] [scapegoat] Use of var - org.ensime.util.ClassIterator.scala:22
[warning] [scapegoat] Use of var - org.ensime.util.ClassIterator.scala:157
[   info] [scapegoat]: Inspecting compilation unit [FileUtil.scala]
[warning] [scapegoat] Empty if statement - org.ensime.util.FileUtil.scala:157
[warning] [scapegoat] Expression as statement - org.ensime.util.FileUtil.scala:180

And if you prefer a prettier report, here is a screen shot of the type of HTML report scapegoat generates:

screenshot

Configuration

For instructions on suppressing warnings by file, by inspection or by line see the sbt-scapegoat README.

Lickitung Inspections

There are 3 inspections created or enhanced by Lickitung.

Name Brief Description
UnnecessaryOverride Checks for code that overrides parent method but simply calls super
ImportOrder Import order is not beautiful, should be java->javax->scala->others
NullReturn Return null in function, use Some[T] or None to replace

Original Inspections

There are 107 inspections from original Scapegoat 0.94.0. An overview list see scalac-scapegoat-plugin.