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

cannot disable NonUnitStatement when being used with scala-maven-plugin #459

Open
tribbloid opened this issue Sep 27, 2019 · 0 comments
Open

Comments

@tribbloid
Copy link

  • Severity: Blocker

  • How to reproduce:

When using with scala-maven-plugin, The option NonUnitStatement cannot be disabled:

The following plugin configuration:

  <plugin>
    <groupId>net.alchim31.maven</groupId>
    <artifactId>scala-maven-plugin</artifactId>
    <version>3.3.1</version>
    <executions>
      <execution>
        <id>scala-compile-first</id>
        <phase>process-resources</phase>
        <goals>
          <goal>compile</goal>
        </goals>
      </execution>
      <execution>
        <id>scala-test-compile-first</id>
        <phase>process-test-resources</phase>
        <goals>
          <goal>testCompile</goal>
        </goals>
      </execution>
    </executions>
    <configuration>
      <scalaVersion>${scala.version}</scalaVersion>
      <scalaCompatVersion>${scala.binary.version}</scalaCompatVersion>
      <recompileMode>incremental</recompileMode>
      <useZincServer>true</useZincServer>
      <!--https://tpolecat.github.io/2017/04/25/scalac-flags.html-->
      <args>
        <arg>-target:jvm-${java.version}</arg>
        <arg>-unchecked</arg>
        <arg>-deprecation</arg>
        <arg>-feature</arg>
        <arg>-g:vars</arg>
        <!--<arg>-language:existentials</arg> &lt;!&ndash; often used in project &ndash;&gt;-->

        <arg>-encoding</arg>
        <arg>UTF-8</arg>
        <arg>-language:_</arg>
        <arg>-Xfatal-warnings</arg>
        <arg>-Xlint</arg>
        <arg>-Yno-adapted-args</arg>
        <arg>-Ywarn-dead-code</arg> <!--,        // N.B. doesn't work well with the ??? hole -->
        <arg>-Ywarn-numeric-widen</arg>
        <arg>-Ywarn-value-discard</arg>
        <arg>-Xfuture</arg>
        <arg>-Ypartial-unification</arg>
        <arg>-Ywarn-numeric-widen</arg>        <!--      // Warn when numerics are widened. -->
        <arg>-Ynon-unit-statement</arg>
        <arg>-P:wartremover:only-warn-traverser:org.wartremover.warts.Unsafe</arg>
      </args>

      <javacArgs>
        <javacArg>-source</javacArg>
        <javacArg>${java.version}</javacArg>
        <javacArg>-target</javacArg>
        <javacArg>${java.version}</javacArg>
      </javacArgs>

      <compilerPlugins>
        <compilerPlugin>
          <groupId>org.wartremover</groupId>
          <artifactId>wartremover_${scala.binary.version}</artifactId>
          <version>2.2.1</version>
        </compilerPlugin>

        <compilerPlugin>
          <groupId>com.olegpy</groupId>
          <artifactId>better-monadic-for_${scala.binary.version}</artifactId>
          <version>0.2.4</version>
        </compilerPlugin>
      </compilerPlugins>
      <excludes>
        <exclude>**/.ipynb_checkpoints/*</exclude>
      </excludes>
    </configuration>
  </plugin>

Will simply yield the following error information:

[ERROR] bad option: '-Ynon-unit-statement'

Many test cases rely on this feature, it has to be enabled before other features can be invoked.

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

No branches or pull requests

1 participant