我将directed添加到我的build.sbt中
addCompilerPlugin("org.psywerx.hairyfotr" %% "linter" % "0.1.14")这次又是什么?我可以像往常一样编译我的项目,但看不到来自linter的任何输出。是否需要运行特殊的sbt任务?
发布于 2016-08-25 01:10:02
从他们的documentation:
terminal:
scalac -Xplugin:<path-to-linter-jar>.jar ...
sbt: (in build.sbt)
scalacOptions += "-Xplugin:<path-to-linter-jar>.jar"
maven: (in pom.xml inside scala-maven-plugin configuration)
<configuration>
<args>
<arg>-Xplugin:<path-to-linter-jar>.jar</arg>
</args>
</configuration>然而,对我来说,只需像你一样简单地添加编译器插件就可以了。一种简单的测试方法是将这样的方法放在某个地方:
def f(a: Int) = 10您应该会收到如下所示的警告:
Parameter a is not used in method f.
[warn] def f(a: Int) = 10
[warn] ^https://stackoverflow.com/questions/39129242
复制相似问题