Skip to content

Commit

Permalink
Enable new Xsource:3-cross compilation flag for scala 2.13.14
Browse files Browse the repository at this point in the history
  • Loading branch information
mbaechler committed May 31, 2024
1 parent ec060aa commit 33a64d6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
9 changes: 3 additions & 6 deletions webapp/sources/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ limitations under the License.
<compilerPlugin>
<groupId>org.scalameta</groupId>
<artifactId>semanticdb-scalac_${scala-version}</artifactId>
<version>4.8.14</version>
<version>4.9.1</version>
</compilerPlugin>
</compilerPlugins>
<args>
Expand All @@ -184,7 +184,7 @@ limitations under the License.
-Xlint:_,-nullary-unit,-missing-interpolator -Yno-adapted-args -Ywarn-dead-code -Ywarn-extra-implicit -Ywarn-inaccessible
-Ywarn-infer-any -Ywarn-nullary-override -Ywarn-numeric-widen -Ywarn-unused:imports -Ywarn-unused:locals -Ywarn-unused:privates
-->
<arg>-Xsource:3</arg>
<arg>-Xsource:3-cross</arg>
<arg>-deprecation</arg> <!-- Emit warning and location for usages of deprecated APIs. -->
<arg>-explaintypes</arg> <!-- Explain type errors in more detail. -->
<arg>-feature</arg> <!-- Emit warning and location for usages of features that should be imported explicitly. -->
Expand Down Expand Up @@ -213,9 +213,6 @@ limitations under the License.

<!-- fastparse 3.0.1 emits false unused warning. We must silence them on related files. See: https://github.com/com-lihaoyi/fastparse/issues/285-->
<arg>-Wconf:cat=unused-nowarn&amp;src=com/normation/utils/Version.scala:s,cat=unused-nowarn&amp;src=com/normation/rudder/services/policies/InterpolatedValueCompiler.scala:s</arg>

<!-- this warning is no an actual issue, our smart constructor usage is fine with a scala 3 compiler-->
<arg>-Wconf:msg=constructor modifiers are assumed by synthetic:s</arg>
</args>
<jvmArgs>
<jvmArg>-Xmx${jvmArg-Xmx}</jvmArg>
Expand Down Expand Up @@ -422,7 +419,7 @@ limitations under the License.
<rudder-major-version>8.1</rudder-major-version>
<rudder-version>8.1.3-SNAPSHOT</rudder-version>

<scala-version>2.13.12</scala-version>
<scala-version>2.13.14</scala-version>
<scala-binary-version>2.13</scala-binary-version>
<!-- lift force us to remain with 1.3.0 because of
java.lang.NoSuchMethodError: 'scala.collection.mutable.Stack scala.xml.parsing.NoBindingFactoryAdapter.scopeStack()'net.liftweb.util.Html5Parser.$anonfun$parse$1(HtmlParser.scala:373)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import com.normation.rudder.rest.lift.LiftApiProcessingLogger
import com.normation.zio.*
import net.liftweb.http.InMemoryResponse
import net.liftweb.http.LiftResponse
import scala.annotation.nowarn
import scala.collection.immutable
import zio.json.*
import zio.json.DeriveJsonEncoder
Expand Down Expand Up @@ -132,10 +131,9 @@ object RudderJsonResponse {

// rudder response. The "A" parameter is the business object (or list of it) in the response.
// Success
@nowarn("msg=parameter encoder .* is never used") // used by magnolia macro
def successOne[A](schema: ResponseSchema, obj: A, id: Option[String])(implicit
prettify: Boolean,
encoder: JsonEncoder[A]
encoder: JsonEncoder[A]
): LiftJsonResponse[? <: JsonRudderApiResponse[?]] = {
schema.dataContainer match {
case Some(key) =>
Expand All @@ -146,10 +144,9 @@ object RudderJsonResponse {
generic.success(JsonRudderApiResponse.success(schema, id, obj))
}
}
@nowarn("msg=parameter encoder .* is never used") // used by magnolia macro
def successList[A](schema: ResponseSchema, objs: List[A])(implicit
prettify: Boolean,
encoder: JsonEncoder[A]
encoder: JsonEncoder[A]
): LiftJsonResponse[
? <: JsonRudderApiResponse[? <: immutable.Iterable[Any] with PartialFunction[Int with String, Any] with Equals]
] = {
Expand Down

0 comments on commit 33a64d6

Please sign in to comment.