-
Notifications
You must be signed in to change notification settings - Fork 9
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
GG-6854 - Restrict test dependencies to test scope (Security issue) #89
Conversation
remove scalacheck's Gen from production code using just a random generator to replace Gen; remove property testing from the class as it was not adding value to the test
|
fix all the compiler errors and warnings
|
remove jre8 dependent wiremock test lib as it was breaking tests and hmrc is using jre11 already
|
|
|
||
def getFlags = { | ||
def getFlags: Action[AnyContent] = { | ||
Action.async { implicit request => | ||
Future(Ok(currentFeatureSwitchesAsJson)) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The async
and Future
can be dropped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. If the implicit request
parameter is unused, you can invoke the action builder without the underscore parameter thusly:
def getFlags: Action[AnyContent] = Action {
Ok(currentFeatureSwitchesAsJson)
}
align { | ||
preset = more | ||
tokens = [ | ||
"extends", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add ":"
to these tokens to maintain alignment of type annotations in parameter lists. The Scalariform config had something to align parameter type annotations so continuing the tradition with Scalafmt will make the diff a little quieter.
project/AppDependencies.scala
Outdated
"org.mockito" %% "mockito-scala-scalatest" % "1.17.12" % testScope, | ||
"org.scalacheck" %% "scalacheck" % "1.17.0" % testScope, | ||
"com.github.fge" % "json-schema-validator" % "2.2.6" % testScope, | ||
"com.vladsch.flexmark" % "flexmark-all" % "0.64.0" % testScope | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think instead of assigning testScope to a val
, it's better to just put .map(_ % "test, it")
here.
compilerPlugin("com.github.ghik" % "silencer-plugin" % "1.7.9" cross CrossVersion.full), | ||
"com.github.ghik" % "silencer-lib" % "1.7.9" % Provided cross CrossVersion.full | ||
compilerPlugin("com.github.ghik" % "silencer-plugin" % silencerVersion cross CrossVersion.full), | ||
"com.github.ghik" % "silencer-lib" % silencerVersion % Provided cross CrossVersion.full |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
project/plugins.sbt
Outdated
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.8.19") | ||
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6") | ||
addSbtPlugin("org.scalariform" % "sbt-scalariform" % "1.8.3") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scalariform can be deleted.
|
||
def getFlags = { | ||
def getFlags: Action[AnyContent] = { | ||
Action.async { implicit request => | ||
Future(Ok(currentFeatureSwitchesAsJson)) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. If the implicit request
parameter is unused, you can invoke the action builder without the underscore parameter thusly:
def getFlags: Action[AnyContent] = Action {
Ok(currentFeatureSwitchesAsJson)
}
use Action's default constructor
https://jira.tools.tax.service.gov.uk/browse/GG-6854