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

can't exclude java sources #141

Open
domdorn opened this issue Jan 6, 2022 · 0 comments
Open

can't exclude java sources #141

domdorn opened this issue Jan 6, 2022 · 0 comments
Labels
needs triage Needs some investigation to answer

Comments

@domdorn
Copy link
Contributor

domdorn commented Jan 6, 2022

I have the following contents in a java file in my java sources
src/main/com/acme/ScalaOptionValueExtractor.java

package com.acme;

import javax.validation.valueextraction.ExtractedValue;
import javax.validation.valueextraction.ValueExtractor;

public class ScalaOptionValueExtractor implements ValueExtractor<scala.Option<@ExtractedValue()?>> {

  @Override
  public void extractValues(scala.Option<?> originalValue, ValueReceiver receiver) {
    if(originalValue.isDefined()) {
      receiver.value(null, originalValue.get());
    }
  }
}

when executing scapegoat through sbt, I'm getting the following log:

[info] [scapegoat] Removing scapegoat class directory: /Users/domdorn/acme/masterdata-service/target/scapegoat-classes
[info] [scapegoat] setting output dir to [/Users/domdorn/acme/masterdata-service/target/scapegoat-report]
[info] [scapegoat] ignored file patterns: .*java
[info] [scapegoat] source prefix: src/main/scala
[info] [scapegoat] minimal warn level: info
[info] compiling 19 Scala sources and 99 Java sources to /Users/domdorn/acme/masterdata-service/target/scapegoat-classes ...
[error] /Users/domdorn/acme/masterdata-service/src/main/java/com/acme/ScalaOptionValueExtractor.java:6:97: illegal start of type
[error] public class ScalaOptionValueExtractor implements ValueExtractor<scala.Option<@ExtractedValue() ?>> {
[error]                                                                                                 ^
[error] /Users/domdorn/acme/masterdata-service/src/main/java/com/acme/ScalaOptionValueExtractor.java:14:2: `>` expected but eof found.
[error] }
[error]  ^
[error] /Users/domdorn/acme/masterdata-service/src/main/java/com/acme/VavrOptionValueExtractor.java:6:106: illegal start of type
[error] public class VavrOptionValueExtractor implements ValueExtractor<io.vavr.control.Option<@ExtractedValue() ?>> {
[error]                                                                                                          ^
[error] /Users/domdorn/acme/masterdata-service/src/main/java/com/acme/VavrOptionValueExtractor.java:14:2: `>` expected but eof found.
[error] }
[error]  ^
[error] four errors found
[error] (Scapegoat / compileIncremental) Compilation failed

I tried disabling scapegoat for java files by setting:

scapegoatIgnoredFiles := Seq(".*java"),

but that doesn't work.
Any help highly appreciated - this is currently blocking my PR :/

@Johnnei Johnnei added the needs triage Needs some investigation to answer label May 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Needs some investigation to answer
Projects
None yet
Development

No branches or pull requests

2 participants