Exclude game route file - generated code from WartRemover

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

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

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

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

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

How to exclude routes from wartremover scan?

+4
source share
2 answers

You tried to put -Xprint:typerin scalacOptionsto see which package is the problem. It seems to work for me when I ignore the following

wartremoverExcluded ++= Seq("Routes", "controllers.ref")
0

, wartremover 0.11, - 0.12, :

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

All Articles