我将build.sbt添加为
directed:
addCompilerPlugin("org.psywerx.hairyfotr" %% "linter" % "0.1.14")
怎么办?我可以像往常一样编译我的项目,但是看不到linter的任何输出.我需要运行一个特殊的sbt任务吗?
解决方法
从他们
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] ^