从 WartRemover 中排除播放路径文件 - 生成的代码 [英] exclude play route file -generated code from WartRemover

查看:55
本文介绍了从 WartRemover 中排除播放路径文件 - 生成的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在游戏项目中使用 WartRemover.我想从 Wartremover 扫描中排除路由文件(从中生成的代码).我添加了以下内容,但它仍会扫描播放 routes 生成的代码.

I am using WartRemover in a play project. I want to exclude routes file (generated code from it) from Wartremover scanning. I added following but it still scans play routes generated code.

wartremoverExcluded ++= Seq("com.xxx.controllers.ReverseMyController","com.xxx.controllers.javascript.ReverseMyController","com.xxx.controllers.ref.ReverseMyController")

并且它仍然显示为 routes 播放文件生成的代码中的疣错误.例如

And it still shows wart errors from the generated code for routes play file. for e.g.

warn] /xxx/conf/routes:23: Inferred type containing Nothing
warn] PUT /service/myendpoint      com.xxx.controllers.MyController.postMyData

同样适用于路由文件中定义的更多路由.

and same for many more routes defined in the routes file.

如何从wartremover扫描中排除路线?

How to exclude routes from wartremover scan?

推荐答案

看起来这个问题是在 wartremover 0.11 的上下文中提出的,但如果有人发现自己在这里寻找 0.12 的解决方案,这对我有用:

It looks like this question was asked in the context of wartremover 0.11, but if anyone finds themselves here looking for a solution for 0.12, this works for me:

wartremoverExcluded += sourceManaged.value / "main" / "routes_reverseRouting.scala"
wartremoverExcluded += sourceManaged.value / "main" / "routes_routing.scala"

这篇关于从 WartRemover 中排除播放路径文件 - 生成的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆