我在一个游戏项目中使用 WartRemover。我想从 Wartremover 扫描中排除路由文件(从中生成的代码)。我添加了以下内容,但它仍然扫描播放routes生成的代码。
wartremoverExcluded ++= Seq("com.xxx.controllers.ReverseMyController","com.xxx.controllers.javascript.ReverseMyController","com.xxx.controllers.ref.ReverseMyController")
Run Code Online (Sandbox Code Playgroud)
它仍然显示routes播放文件生成的代码中的疣错误。例如
warn] /xxx/conf/routes:23: Inferred type containing Nothing
warn] PUT /service/myendpoint com.xxx.controllers.MyController.postMyData
Run Code Online (Sandbox Code Playgroud)
对于路由文件中定义的更多路由也是如此。
如何从 wartremover 扫描中排除路由?
您是否尝试过放入-Xprint:typer其中scalacOptions看看是哪个包有问题。当我忽略以下内容时,它似乎对我有用
wartremoverExcluded ++= Seq("Routes", "controllers.ref")
Run Code Online (Sandbox Code Playgroud)