Skip to content

Commit c93020f

Browse files
committed
ThisBuild / scalafix RemoveUnused
+ ThisBuild / scalafmt
1 parent ef8c506 commit c93020f

100 files changed

Lines changed: 76 additions & 353 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

admin/app/controllers/FrontPressController.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,25 @@ class FrontPressController(pekkoAsync: PekkoAsync, val controllerComponents: Con
1717
}
1818

1919
def queueAllFrontsForPress(): Action[AnyContent] =
20-
Action { implicit request =>
20+
Action { _ =>
2121
RefreshFrontsJob.runAll(pekkoAsync) match {
2222
case Some(l) => Ok(s"Pushed ${l.length} fronts to the SQS queue")
2323
case None => InternalServerError("Could not push to the SQS queue, is there an SNS topic set? (frontPressSns)")
2424
}
2525
}
2626

2727
def queueHighFrequencyFrontsForPress(): Action[AnyContent] =
28-
Action { implicit request =>
28+
Action { _ =>
2929
runJob(RefreshFrontsJob.runFrequency(pekkoAsync)(HighFrequency), "high frequency")
3030
}
3131

3232
def queueStandardFrequencyFrontsForPress(): Action[AnyContent] =
33-
Action { implicit request =>
33+
Action { _ =>
3434
runJob(RefreshFrontsJob.runFrequency(pekkoAsync)(StandardFrequency), "standard frequency")
3535
}
3636

3737
def queueLowFrequencyFrontsForPress(): Action[AnyContent] =
38-
Action { implicit request =>
38+
Action { _ =>
3939
runJob(RefreshFrontsJob.runFrequency(pekkoAsync)(LowFrequency), "low frequency")
4040
}
4141

admin/app/controllers/admin/CommercialController.scala

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,13 @@ package controllers.admin
22

33
import common.dfp.{GuCustomField, GuLineItem}
44
import common.{ImplicitControllerExecutionContext, JsonComponent, GuLogging}
5-
import conf.Configuration
65
import dfp.{DfpDataExtractor}
76
import model._
87
import services.ophan.SurgingContentAgent
9-
import play.api.libs.json.{JsString, Json}
108
import play.api.mvc._
119
import tools._
12-
import conf.switches.Switches.{LineItemJobs}
1310

1411
import scala.concurrent.duration._
15-
import scala.util.Try
1612

1713
class CommercialController(
1814
val controllerComponents: ControllerComponents,
@@ -110,7 +106,7 @@ class CommercialController(
110106
}
111107

112108
def renderKeyValuesCsv(key: String): Action[AnyContent] =
113-
Action { implicit request =>
109+
Action { _ =>
114110
val csv: Option[String] = Store.getDfpCustomTargetingKeyValues.find(_.name == key).map { selectedKey =>
115111
selectedKey.values
116112
.map(targetValue => {

admin/app/controllers/admin/InteractiveLibrarianController.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class InteractiveLibrarianController(
3030
* success or failure, including message
3131
*/
3232
def press(path: String): Action[AnyContent] =
33-
Action.async { implicit request =>
33+
Action.async { _ =>
3434
for {
3535
_ <- InteractiveLibrarian.pressLiveContents(wsClient, path)
3636
} yield {
@@ -44,7 +44,7 @@ class InteractiveLibrarianController(
4444
}
4545

4646
def liveContentsPress(path: String): Action[AnyContent] = {
47-
Action.async { implicit request =>
47+
Action.async { _ =>
4848
if (ContentPresser.isSwitchedOn) {
4949
InteractiveLibrarian.pressLiveContents(wsClient, path).map { message =>
5050
Ok(message)
@@ -56,7 +56,7 @@ class InteractiveLibrarianController(
5656
}
5757

5858
def readCleanWrite(path: String): Action[AnyContent] = {
59-
Action.async { implicit request =>
59+
Action.async { _ =>
6060
if (ContentPresser.isSwitchedOn) {
6161
val status = InteractiveLibrarian.readCleanWrite(path)
6262
Future.successful(Ok(status.toString()))

admin/app/controllers/admin/SwitchboardController.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package controllers.admin
22

33
import common._
4-
import conf.Configuration
54
import conf.switches.Switches
65
import http.GuardianAuthWithExemptions
76
import model.{ApplicationContext, NoCache}
@@ -65,7 +64,7 @@ class SwitchboardController(
6564
) getOrElse "unknown user (dev-build?)"
6665
val updates: Seq[String] = request.body.asFormUrlEncoded.map { params =>
6766
Switches.all map { switch =>
68-
switch.name + "=" + params.get(switch.name).map(v => "on").getOrElse("off")
67+
switch.name + "=" + params.get(switch.name).map(_ => "on").getOrElse("off")
6968
}
7069
} getOrElse Nil
7170

admin/app/controllers/cache/ImageDecacheController.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class ImageDecacheController(
6464
originImage = Some(originUrl),
6565
),
6666
)
67-
case status =>
67+
case _ =>
6868
Ok(
6969
views.html.cache.imageDecache(
7070
messageType = Error,

admin/app/controllers/metrics/MetricsController.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import play.api.libs.ws.WSClient
55
import play.api.mvc.{Action, AnyContent, BaseController, ControllerComponents}
66
import tools._
77
import model.{ApplicationContext, NoCache}
8-
import conf.{Configuration, Static}
8+
import conf.Configuration
99

1010
class MetricsController(
1111
wsClient: WSClient,

admin/app/football/controllers/PaBrowserController.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class PaBrowserController(val wsClient: WSClient, val controllerComponents: Cont
4343
}
4444

4545
def browser(query: String): Action[AnyContent] =
46-
Action.async { implicit request =>
46+
Action.async { _ =>
4747
val replacedQuery = URLDecoder.decode(query, "UTF-8").replace("{apiKey}", client.apiKey)
4848
client.get("/" + replacedQuery).map { content =>
4949
val response = Ok(content)

admin/app/indexes/TagPages.scala

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ import common.GuLogging
55
import common.StringEncodings.asAscii
66
import model.{TagDefinition, TagIndex}
77

8-
import scala.concurrent.ExecutionContext
9-
import scala.util.Try
10-
118
object TagPages extends GuLogging {
129

1310
/** To be curated by Peter Martin */

admin/app/purge/CdnPurge.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package purge
22

33
import common.GuLogging
4-
import conf.AdminConfiguration.fastly
54
import conf.Configuration.environment
65
import implicits.Dates
76
import play.api.libs.ws.{WSClient, WSResponse}

admin/app/tools/Store.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import conf.{AdminConfiguration, Configuration}
88
import implicits.Dates
99
import org.joda.time.DateTime
1010
import play.api.libs.json.{JsError, JsSuccess, Json}
11-
import play.api.libs.json.Json.toJson
1211
import services.S3
1312

1413
trait Store extends GuLogging with Dates {

0 commit comments

Comments
 (0)