Skip to content

Commit

Permalink
Merge pull request #198 from hmrc/Tom/DLS-10610/address-compilation-w…
Browse files Browse the repository at this point in the history
…arnings

DLS-10610 - address compilation warnings
  • Loading branch information
TomRafferty authored Jul 15, 2024
2 parents 1fb0934 + ac78a6b commit d20211e
Show file tree
Hide file tree
Showing 24 changed files with 43 additions and 63 deletions.
2 changes: 1 addition & 1 deletion app/controllers/utils/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ package object utils {
case e: NoSuchElementException =>
logger.warn(s"${request.uri} resulted in None.get, user redirected to start")
throw ApplicationException(
Redirect(controllers.utils.routes.TimeoutController.timeout),
Redirect(controllers.utils.routes.TimeoutController.timeout()),
e.getMessage
)
}
Expand Down
4 changes: 2 additions & 2 deletions app/models/SummaryDataItemModel.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

package models

import play.api.libs.json.Json
import play.api.libs.json.{Json, OFormat}

case class SummaryDataItemModel (question: String, answer: String, link: Option[String] = None)

object SummaryDataItemModel {
implicit val format = Json.format[SummaryDataItemModel]
implicit val format: OFormat[SummaryDataItemModel] = Json.format[SummaryDataItemModel]
}
4 changes: 2 additions & 2 deletions app/models/resident/AcquisitionCostsModel.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

package models.resident

import play.api.libs.json.Json
import play.api.libs.json.{Json, OFormat}

case class AcquisitionCostsModel (amount: BigDecimal)

object AcquisitionCostsModel {
implicit val format = Json.format[AcquisitionCostsModel]
implicit val format: OFormat[AcquisitionCostsModel] = Json.format[AcquisitionCostsModel]
}
4 changes: 2 additions & 2 deletions app/models/resident/AcquisitionValueModel.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

package models.resident

import play.api.libs.json.Json
import play.api.libs.json.{Json, OFormat}

case class AcquisitionValueModel (amount: BigDecimal)

object AcquisitionValueModel {
implicit val format = Json.format[AcquisitionValueModel]
implicit val format: OFormat[AcquisitionValueModel] = Json.format[AcquisitionValueModel]
}
4 changes: 2 additions & 2 deletions app/models/resident/ChargeableGainResultModel.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package models.resident

import play.api.libs.json.Json
import play.api.libs.json.{Json, OFormat}

case class ChargeableGainResultModel (
gain: BigDecimal,
Expand All @@ -33,5 +33,5 @@ case class ChargeableGainResultModel (
)

object ChargeableGainResultModel {
implicit val format = Json.format[ChargeableGainResultModel]
implicit val format: OFormat[ChargeableGainResultModel] = Json.format[ChargeableGainResultModel]
}
4 changes: 2 additions & 2 deletions app/models/resident/DisposalCostsModel.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

package models.resident

import play.api.libs.json.Json
import play.api.libs.json.{Json, OFormat}

case class DisposalCostsModel(amount: BigDecimal)

object DisposalCostsModel {
implicit val format = Json.format[DisposalCostsModel]
implicit val format: OFormat[DisposalCostsModel] = Json.format[DisposalCostsModel]
}
4 changes: 2 additions & 2 deletions app/models/resident/DisposalDateModel.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

package models.resident

import play.api.libs.json.Json
import play.api.libs.json.{Json, OFormat}

case class DisposalDateModel (day: Int, month: Int, year: Int)

object DisposalDateModel {
implicit val formats = Json.format[DisposalDateModel]
implicit val formats: OFormat[DisposalDateModel] = Json.format[DisposalDateModel]
}
4 changes: 2 additions & 2 deletions app/models/resident/DisposalValueModel.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

package models.resident

import play.api.libs.json.Json
import play.api.libs.json.{Json, OFormat}

case class DisposalValueModel(amount: BigDecimal)

object DisposalValueModel {
implicit val format = Json.format[DisposalValueModel]
implicit val format: OFormat[DisposalValueModel] = Json.format[DisposalValueModel]
}
4 changes: 2 additions & 2 deletions app/models/resident/LossesBroughtForwardModel.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

package models.resident

import play.api.libs.json.Json
import play.api.libs.json.{Json, OFormat}

case class LossesBroughtForwardModel(option : Boolean)

object LossesBroughtForwardModel {
implicit val format = Json.format[LossesBroughtForwardModel]
implicit val format: OFormat[LossesBroughtForwardModel] = Json.format[LossesBroughtForwardModel]
}
4 changes: 2 additions & 2 deletions app/models/resident/LossesBroughtForwardValueModel.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

package models.resident

import play.api.libs.json.Json
import play.api.libs.json.{Json, OFormat}

case class LossesBroughtForwardValueModel (amount: BigDecimal)

object LossesBroughtForwardValueModel {
implicit val format = Json.format[LossesBroughtForwardValueModel]
implicit val format: OFormat[LossesBroughtForwardValueModel] = Json.format[LossesBroughtForwardValueModel]
}
4 changes: 2 additions & 2 deletions app/models/resident/SellForLessModel.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

package models.resident

import play.api.libs.json.Json
import play.api.libs.json.{Json, OFormat}

case class SellForLessModel (sellForLess: Boolean)

object SellForLessModel {
implicit val format = Json.format[SellForLessModel]
implicit val format: OFormat[SellForLessModel] = Json.format[SellForLessModel]
}
4 changes: 2 additions & 2 deletions app/models/resident/TotalGainAndTaxOwedModel.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package models.resident

import play.api.libs.json.Json
import play.api.libs.json.{Json, OFormat}

case class TotalGainAndTaxOwedModel(gain: BigDecimal,
chargeableGain: BigDecimal,
Expand All @@ -36,5 +36,5 @@ case class TotalGainAndTaxOwedModel(gain: BigDecimal,
)

object TotalGainAndTaxOwedModel {
implicit val formats = Json.format[TotalGainAndTaxOwedModel]
implicit val formats: OFormat[TotalGainAndTaxOwedModel] = Json.format[TotalGainAndTaxOwedModel]
}
4 changes: 2 additions & 2 deletions app/models/resident/WorthWhenInheritedModel.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

package models.resident

import play.api.libs.json.Json
import play.api.libs.json.{Json, OFormat}

case class WorthWhenInheritedModel (amount: BigDecimal)

object WorthWhenInheritedModel {
implicit val format = Json.format[WorthWhenInheritedModel]
implicit val format: OFormat[WorthWhenInheritedModel] = Json.format[WorthWhenInheritedModel]
}
4 changes: 2 additions & 2 deletions app/models/resident/WorthWhenSoldForLessModel.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

package models.resident

import play.api.libs.json.Json
import play.api.libs.json.{Json, OFormat}

case class WorthWhenSoldForLessModel(amount: BigDecimal)

object WorthWhenSoldForLessModel {
implicit val format = Json.format[WorthWhenSoldForLessModel]
implicit val format: OFormat[WorthWhenSoldForLessModel] = Json.format[WorthWhenSoldForLessModel]
}
4 changes: 2 additions & 2 deletions app/models/resident/income/CurrentIncomeModel.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

package models.resident.income

import play.api.libs.json.Json
import play.api.libs.json.{Json, OFormat}

case class CurrentIncomeModel(amount: BigDecimal)

object CurrentIncomeModel {
implicit val format = Json.format[CurrentIncomeModel]
implicit val format: OFormat[CurrentIncomeModel] = Json.format[CurrentIncomeModel]
}
4 changes: 2 additions & 2 deletions app/models/resident/income/PersonalAllowanceModel.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

package models.resident.income

import play.api.libs.json.Json
import play.api.libs.json.{Json, OFormat}

case class PersonalAllowanceModel(amount: BigDecimal)

object PersonalAllowanceModel {
implicit val format = Json.format[PersonalAllowanceModel]
implicit val format: OFormat[PersonalAllowanceModel] = Json.format[PersonalAllowanceModel]
}
4 changes: 2 additions & 2 deletions app/models/resident/income/PreviousTaxableGainsModel.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

package models.resident.income

import play.api.libs.json.Json
import play.api.libs.json.{Json, OFormat}

case class PreviousTaxableGainsModel(amount: BigDecimal)

object PreviousTaxableGainsModel {
implicit val format = Json.format[PreviousTaxableGainsModel]
implicit val format: OFormat[PreviousTaxableGainsModel] = Json.format[PreviousTaxableGainsModel]
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

package models.resident.shares

import play.api.libs.json.Json
import play.api.libs.json.{Json, OFormat}

case class OwnerBeforeLegislationStartModel(ownerBeforeLegislationStart: Boolean)

object OwnerBeforeLegislationStartModel {
implicit val format = Json.format[OwnerBeforeLegislationStartModel]
implicit val format: OFormat[OwnerBeforeLegislationStartModel] = Json.format[OwnerBeforeLegislationStartModel]
}
4 changes: 2 additions & 2 deletions app/models/resident/shares/gain/DidYouInheritThemModel.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

package models.resident.shares.gain

import play.api.libs.json.Json
import play.api.libs.json.{Json, OFormat}

case class DidYouInheritThemModel(wereInherited: Boolean)

object DidYouInheritThemModel {
implicit val format = Json.format[DidYouInheritThemModel]
implicit val format: OFormat[DidYouInheritThemModel] = Json.format[DidYouInheritThemModel]
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

package models.resident.shares.gain

import play.api.libs.json.Json
import play.api.libs.json.{Json, OFormat}

case class ValueBeforeLegislationStartModel(amount: BigDecimal)

object ValueBeforeLegislationStartModel {
implicit val format = Json.format[ValueBeforeLegislationStartModel]
implicit val format: OFormat[ValueBeforeLegislationStartModel] = Json.format[ValueBeforeLegislationStartModel]
}
2 changes: 2 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ lazy val microservice = Project(appName, file("."))
.settings(integrationTestSettings())
.settings(isPublicArtefact := true)
.settings(
scalacOptions.+=("-Wconf:src=html/.*:s"), //suppresses warnings in twirl files and routes.
scalacOptions.+=("-Wconf:src=routes/.*:s"), //these warnings are loud and inconsequential.
TwirlKeys.templateImports ++= Seq(
"uk.gov.hmrc.govukfrontend.views.html.components._",
"uk.gov.hmrc.hmrcfrontend.views.html.components._",
Expand Down
22 changes: 0 additions & 22 deletions conf/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,13 @@
</encoder>
</appender>

<appender name="STDOUT_IGNORE_NETTY" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>%date{ISO8601} level=[%level] logger=[%logger] thread=[%thread] rid=[not-available] user=[not-available] message=[%message] %replace(exception=[%xException]){'^exception=\[\]$',''}%n</pattern>
</encoder>
</appender>

<appender name="ACCESS_LOG_FILE" class="ch.qos.logback.core.FileAppender">
<file>logs/access.log</file>
<encoder>
<pattern>%message%n</pattern>
</encoder>
</appender>

<appender name="CONNECTOR_LOG_FILE" class="ch.qos.logback.core.FileAppender">
<file>logs/connector.log</file>
<encoder>
<pattern>%message%n</pattern>
</encoder>
</appender>


<logger name="accesslog" level="INFO" additivity="false">
<appender-ref ref="ACCESS_LOG_FILE" />
</logger>

<logger name="com.ning.http.client.providers.netty" additivity="false">
<appender-ref ref="STDOUT_IGNORE_NETTY" />
</logger>

<logger name="uk.gov" level="WARN"/>

<logger name="application" level="DEBUG"/>
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.9.7
sbt.version=1.9.9
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
resolvers += MavenRepository("HMRC-open-artefacts-maven2", "https://open.artefacts.tax.service.gov.uk/maven2")
resolvers += Resolver.url("HMRC-open-artefacts-ivy", url("https://open.artefacts.tax.service.gov.uk/ivy2"))(Resolver.ivyStylePatterns)

addSbtPlugin("uk.gov.hmrc" % "sbt-auto-build" % "3.21.0")
addSbtPlugin("uk.gov.hmrc" % "sbt-auto-build" % "3.22.0")
addSbtPlugin("uk.gov.hmrc" % "sbt-distributables" % "2.5.0")
addSbtPlugin("org.playframework" % "sbt-plugin" % "3.0.2")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.11")
Expand Down

0 comments on commit d20211e

Please sign in to comment.