Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make Scala compiler stop on first error

Tags:

I'd like scalac to stop the build on the first error. I've been finding a large number of cases where all subsequent errors are caused directly by the first error, so those subsequent errors are just noise and I'd like to remove that.

Is there an option that I can pass to scalac to do this?

If it matters, I'm working on a Play Framework project and building via the Activator (using ~run to automatically rebuild on changes).

like image 624
Kat Avatar asked Dec 15 '14 21:12

Kat


1 Answers

In sbt this is done quite simply by seting the maxErrors setting:

maxErrors := 1

If you want to set it temporarily for your current session, just do:

set maxErrors := 1

just before doing ~run

like image 175
Régis Jean-Gilles Avatar answered Sep 29 '22 04:09

Régis Jean-Gilles