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

Enable new Xsource:3-cross compilation flag for scala 2.13.14 #5699

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -88,7 +88,6 @@ import org.joda.time.DateTime
import org.joda.time.Duration
import org.junit.runner.RunWith
import org.specs2.runner.JUnitRunner
import scala.annotation.nowarn
import scala.collection.SortedMap
import scala.concurrent.duration.FiniteDuration
import zio.*
Expand Down Expand Up @@ -178,7 +177,6 @@ class ReportingServiceTest extends DBCommon with BoxSpecMatcher {
def getGlobalUserCompliance()(implicit qc: QueryContext): Box[Option[(ComplianceLevel, Long)]] = null
def findUncomputedNodeStatusReports(): Box[Map[NodeId, NodeStatusReport]] = null

@nowarn("msg=parameter.*is never used")
def getUserNodeStatusReports()(implicit qc: QueryContext): Box[Map[NodeId, NodeStatusReport]] = Full(Map())
def getSystemAndUserCompliance(
optNodeIds: Option[Set[NodeId]]
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