5

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")

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.

How to exclude routes from wartremover scan?

user2066049
  • 1,371
  • 1
  • 12
  • 26
  • Not sure if this will help much but while I've noticed that `Wart.Nothing` seems to fail on the routes file even when it's been excluded, others such as `Wart.Any`, `Wart.Product` and `Wart.Serializable` seem to behave correctly. – Klugscheißer Nov 20 '14 at 21:34

2 Answers2

0

Have you tried putting -Xprint:typer in scalacOptions to see which package is the issue. It seems to work for me when I ignore the following

wartremoverExcluded ++= Seq("Routes", "controllers.ref")
Klugscheißer
  • 1,575
  • 1
  • 11
  • 24
0

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"
danielnixon
  • 4,178
  • 1
  • 27
  • 39