From b308f5de6a46bee86c450936c49a58278a5e8d16 Mon Sep 17 00:00:00 2001
From: TomRafferty <86563641+TomRafferty@users.noreply.github.com>
Date: Tue, 2 Jul 2024 15:20:43 +0100
Subject: [PATCH 1/3] DLS-10610 - fix for twirl comment and route file "unused
import" warnings
suppressed warnings for twirl files and routes as they are loud and inconsequential. This is for warnings such as "unused imports" being triggered by twirl comments (mistaking the "@*" for an import rather than a comment)
a
---
build.sbt | 2 ++
1 file changed, 2 insertions(+)
diff --git a/build.sbt b/build.sbt
index 837ed76..7619374 100644
--- a/build.sbt
+++ b/build.sbt
@@ -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._",
From dc92e47d49440552c4832982aab87cc772bed28a Mon Sep 17 00:00:00 2001
From: TomRafferty <86563641+TomRafferty@users.noreply.github.com>
Date: Tue, 2 Jul 2024 15:48:45 +0100
Subject: [PATCH 2/3] DLS-10610 - PR bot changes
---
conf/logback.xml | 22 ----------------------
project/build.properties | 2 +-
project/plugins.sbt | 2 +-
3 files changed, 2 insertions(+), 24 deletions(-)
diff --git a/conf/logback.xml b/conf/logback.xml
index 4a0dd93..1360416 100644
--- a/conf/logback.xml
+++ b/conf/logback.xml
@@ -14,19 +14,6 @@
-
-
- %date{ISO8601} level=[%level] logger=[%logger] thread=[%thread] rid=[not-available] user=[not-available] message=[%message] %replace(exception=[%xException]){'^exception=\[\]$',''}%n
-
-
-
-
- logs/access.log
-
- %message%n
-
-
-
logs/connector.log
@@ -34,15 +21,6 @@
-
-
-
-
-
-
-
-
-
diff --git a/project/build.properties b/project/build.properties
index e8a1e24..04267b1 100644
--- a/project/build.properties
+++ b/project/build.properties
@@ -1 +1 @@
-sbt.version=1.9.7
+sbt.version=1.9.9
diff --git a/project/plugins.sbt b/project/plugins.sbt
index 90518c7..be146f2 100644
--- a/project/plugins.sbt
+++ b/project/plugins.sbt
@@ -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")
From ac78a6b898d51ed0083b5e7b180c57007e723b00 Mon Sep 17 00:00:00 2001
From: TomRafferty <86563641+TomRafferty@users.noreply.github.com>
Date: Tue, 2 Jul 2024 16:12:15 +0100
Subject: [PATCH 3/3] DLS-10610 - explicit type warnings and missing
parentheses warning addressed (manual)
---
app/controllers/utils/package.scala | 2 +-
app/models/SummaryDataItemModel.scala | 4 ++--
app/models/resident/AcquisitionCostsModel.scala | 4 ++--
app/models/resident/AcquisitionValueModel.scala | 4 ++--
app/models/resident/ChargeableGainResultModel.scala | 4 ++--
app/models/resident/DisposalCostsModel.scala | 4 ++--
app/models/resident/DisposalDateModel.scala | 4 ++--
app/models/resident/DisposalValueModel.scala | 4 ++--
app/models/resident/LossesBroughtForwardModel.scala | 4 ++--
app/models/resident/LossesBroughtForwardValueModel.scala | 4 ++--
app/models/resident/SellForLessModel.scala | 4 ++--
app/models/resident/TotalGainAndTaxOwedModel.scala | 4 ++--
app/models/resident/WorthWhenInheritedModel.scala | 4 ++--
app/models/resident/WorthWhenSoldForLessModel.scala | 4 ++--
app/models/resident/income/CurrentIncomeModel.scala | 4 ++--
app/models/resident/income/PersonalAllowanceModel.scala | 4 ++--
app/models/resident/income/PreviousTaxableGainsModel.scala | 4 ++--
.../resident/shares/OwnerBeforeLegislationStartModel.scala | 4 ++--
app/models/resident/shares/gain/DidYouInheritThemModel.scala | 4 ++--
.../shares/gain/ValueBeforeLegislationStartModel.scala | 4 ++--
20 files changed, 39 insertions(+), 39 deletions(-)
diff --git a/app/controllers/utils/package.scala b/app/controllers/utils/package.scala
index 2c70edf..ca051a9 100644
--- a/app/controllers/utils/package.scala
+++ b/app/controllers/utils/package.scala
@@ -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
)
}
diff --git a/app/models/SummaryDataItemModel.scala b/app/models/SummaryDataItemModel.scala
index bcfeec4..0f96c0e 100644
--- a/app/models/SummaryDataItemModel.scala
+++ b/app/models/SummaryDataItemModel.scala
@@ -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]
}
diff --git a/app/models/resident/AcquisitionCostsModel.scala b/app/models/resident/AcquisitionCostsModel.scala
index a4ff7d7..02602fb 100644
--- a/app/models/resident/AcquisitionCostsModel.scala
+++ b/app/models/resident/AcquisitionCostsModel.scala
@@ -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]
}
diff --git a/app/models/resident/AcquisitionValueModel.scala b/app/models/resident/AcquisitionValueModel.scala
index e6e0c32..6ec5917 100644
--- a/app/models/resident/AcquisitionValueModel.scala
+++ b/app/models/resident/AcquisitionValueModel.scala
@@ -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]
}
diff --git a/app/models/resident/ChargeableGainResultModel.scala b/app/models/resident/ChargeableGainResultModel.scala
index 5f2ea2a..972b3c7 100644
--- a/app/models/resident/ChargeableGainResultModel.scala
+++ b/app/models/resident/ChargeableGainResultModel.scala
@@ -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,
@@ -33,5 +33,5 @@ case class ChargeableGainResultModel (
)
object ChargeableGainResultModel {
- implicit val format = Json.format[ChargeableGainResultModel]
+ implicit val format: OFormat[ChargeableGainResultModel] = Json.format[ChargeableGainResultModel]
}
diff --git a/app/models/resident/DisposalCostsModel.scala b/app/models/resident/DisposalCostsModel.scala
index ed05148..50e10ed 100644
--- a/app/models/resident/DisposalCostsModel.scala
+++ b/app/models/resident/DisposalCostsModel.scala
@@ -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]
}
diff --git a/app/models/resident/DisposalDateModel.scala b/app/models/resident/DisposalDateModel.scala
index 2ecc5f4..a669110 100644
--- a/app/models/resident/DisposalDateModel.scala
+++ b/app/models/resident/DisposalDateModel.scala
@@ -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]
}
diff --git a/app/models/resident/DisposalValueModel.scala b/app/models/resident/DisposalValueModel.scala
index d68368a..931ed6e 100644
--- a/app/models/resident/DisposalValueModel.scala
+++ b/app/models/resident/DisposalValueModel.scala
@@ -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]
}
diff --git a/app/models/resident/LossesBroughtForwardModel.scala b/app/models/resident/LossesBroughtForwardModel.scala
index aa20169..f862cf1 100644
--- a/app/models/resident/LossesBroughtForwardModel.scala
+++ b/app/models/resident/LossesBroughtForwardModel.scala
@@ -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]
}
diff --git a/app/models/resident/LossesBroughtForwardValueModel.scala b/app/models/resident/LossesBroughtForwardValueModel.scala
index c9da63f..294c40e 100644
--- a/app/models/resident/LossesBroughtForwardValueModel.scala
+++ b/app/models/resident/LossesBroughtForwardValueModel.scala
@@ -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]
}
diff --git a/app/models/resident/SellForLessModel.scala b/app/models/resident/SellForLessModel.scala
index 15f3ac7..d8529e6 100644
--- a/app/models/resident/SellForLessModel.scala
+++ b/app/models/resident/SellForLessModel.scala
@@ -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]
}
diff --git a/app/models/resident/TotalGainAndTaxOwedModel.scala b/app/models/resident/TotalGainAndTaxOwedModel.scala
index c73b8ad..2467887 100644
--- a/app/models/resident/TotalGainAndTaxOwedModel.scala
+++ b/app/models/resident/TotalGainAndTaxOwedModel.scala
@@ -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,
@@ -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]
}
diff --git a/app/models/resident/WorthWhenInheritedModel.scala b/app/models/resident/WorthWhenInheritedModel.scala
index 6b819e3..75af71e 100644
--- a/app/models/resident/WorthWhenInheritedModel.scala
+++ b/app/models/resident/WorthWhenInheritedModel.scala
@@ -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]
}
diff --git a/app/models/resident/WorthWhenSoldForLessModel.scala b/app/models/resident/WorthWhenSoldForLessModel.scala
index d2fe7b3..d3a44a1 100644
--- a/app/models/resident/WorthWhenSoldForLessModel.scala
+++ b/app/models/resident/WorthWhenSoldForLessModel.scala
@@ -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]
}
diff --git a/app/models/resident/income/CurrentIncomeModel.scala b/app/models/resident/income/CurrentIncomeModel.scala
index 969f424..e6994ab 100644
--- a/app/models/resident/income/CurrentIncomeModel.scala
+++ b/app/models/resident/income/CurrentIncomeModel.scala
@@ -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]
}
diff --git a/app/models/resident/income/PersonalAllowanceModel.scala b/app/models/resident/income/PersonalAllowanceModel.scala
index 3d7c8b5..0996276 100644
--- a/app/models/resident/income/PersonalAllowanceModel.scala
+++ b/app/models/resident/income/PersonalAllowanceModel.scala
@@ -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]
}
diff --git a/app/models/resident/income/PreviousTaxableGainsModel.scala b/app/models/resident/income/PreviousTaxableGainsModel.scala
index 9b97986..4e9945c 100644
--- a/app/models/resident/income/PreviousTaxableGainsModel.scala
+++ b/app/models/resident/income/PreviousTaxableGainsModel.scala
@@ -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]
}
diff --git a/app/models/resident/shares/OwnerBeforeLegislationStartModel.scala b/app/models/resident/shares/OwnerBeforeLegislationStartModel.scala
index 9fe26f3..273c1f5 100644
--- a/app/models/resident/shares/OwnerBeforeLegislationStartModel.scala
+++ b/app/models/resident/shares/OwnerBeforeLegislationStartModel.scala
@@ -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]
}
diff --git a/app/models/resident/shares/gain/DidYouInheritThemModel.scala b/app/models/resident/shares/gain/DidYouInheritThemModel.scala
index 1be8412..8a80a7e 100644
--- a/app/models/resident/shares/gain/DidYouInheritThemModel.scala
+++ b/app/models/resident/shares/gain/DidYouInheritThemModel.scala
@@ -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]
}
diff --git a/app/models/resident/shares/gain/ValueBeforeLegislationStartModel.scala b/app/models/resident/shares/gain/ValueBeforeLegislationStartModel.scala
index 147ba2c..190e25b 100644
--- a/app/models/resident/shares/gain/ValueBeforeLegislationStartModel.scala
+++ b/app/models/resident/shares/gain/ValueBeforeLegislationStartModel.scala
@@ -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]
}