Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scapegoat doesn't like Play #30

Open
luksow opened this issue Jul 15, 2015 · 8 comments
Open

Scapegoat doesn't like Play #30

luksow opened this issue Jul 15, 2015 · 8 comments

Comments

@luksow
Copy link

luksow commented Jul 15, 2015

Hi,
I'm trying to integrate scapegoat with Play 2.3.4 and it turns out that there're some issues with Play's code generation feature. First of all, scapgegoat is desperately trying to go through compiled templates, spitting out enormous number of issues - this however can be with a rule like scapegoatIgnoredFiles := Seq(".*assets.*", ".*src_managed.*"). The bigger problem is that it fails (2 out of 3 times) during code generation with some cryptic error messages like:
source file '...target/scala-2.11/src_managed/main/assets/controllers/routes.java' could not be found or similar. Any ideas? Thanks!
Łukasz

@sksamuel
Copy link
Collaborator

I'm not familiar with play, what is src_managed?

On 15 July 2015 at 19:40, Łukasz Sowa [email protected] wrote:

Hi,
I'm trying to integrate scapegoat with Play 2.3.4 and it turns out that
there're some issues with Play's code generation feature. First of all,
scapgegoat is desperately trying to go through compiled templates, spitting
out enormous number of issues - this however can be with a rule like scapegoatIgnoredFiles
:= Seq(".assets.", ".src_managed."). The bigger problem is that it
fails (2 out of 3 times) during code generation with some cryptic error
messages like:
source file
'...target/scala-2.11/src_managed/main/assets/controllers/routes.java'
could not be found or similar. Any ideas? Thanks!
Łukasz


Reply to this email directly or view it on GitHub
#30.

@luksow
Copy link
Author

luksow commented Jul 15, 2015

Wow, that was quick! I'm not familiar with Play internals but I guess src_managed is a dir that is being created on-the-fly for generated code. You should be able to repro this bug by creating a template Play project and running scapegoat on it.

@sksamuel
Copy link
Collaborator

can you make me a sample project.

On 15 July 2015 at 19:43, Łukasz Sowa [email protected] wrote:

Wow, that was quick! I'm not familiar with Play internals but I guess
src_managed is a dir that is being created on-the-fly for generated code.
You should be able to repro this bug by creating a template Play project
and running scapegoat on it.


Reply to this email directly or view it on GitHub
#30 (comment)
.

@luksow
Copy link
Author

luksow commented Jul 16, 2015

https://github.com/luksow/play-scapegoat-bug fire up sbt inside play-scapegoat-bug directory, then try different combinations of commands compile clean scapegoat, you'll see plenty of false-positive warnings (complaining about generated code in target dir) and also strange errors on scapegoat command like

[error] source file '/home/luke/projects/play-scapegoat-bug/target/scala-2.11/twirl/main/views/html/index.template.scala' could not be found [error] one error found [error] (scapegoat:compileIncremental) Compilation failed

or

[error] /home/luke/projects/play-scapegoat-bug/app/views/index.scala.html:3: not found: value main [error] @main("Welcome to Play") { [error] ^ [error] one error found [error] (scapegoat:compileIncremental) Compilation failed

@sksamuel
Copy link
Collaborator

Thanks.

@zenderol
Copy link

Having same issue here during builds on Jenkins. Any updated on what causes the problem and how to fix it?

@danielnixon
Copy link

Does this help? https://github.com/danielnixon/sbt-ignore-play-generated

(Play 2.5.x only.)

@yarosman
Copy link

In my play2.5-project with sbt-ignore-play-generated when I execute sbt clean scapegoat I will get

[warn] 28 warnings found  
[error] 34 errors found  
[error] (scapegoat:compileIncremental) Compilation failed

How can I fix it ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants