Conversation
…and fixed deprecation warnings in the build definition.
There was a problem hiding this comment.
Pull Request Overview
This PR addresses various compilation warnings by adding explicit type annotations, removing unused imports, updating deprecated syntax, and bumping the sbt version.
- Added explicit return types for
saveandcreatemethods in repositories - Replaced deprecated Slick tuple mapping syntax and Symbol literals in JSON tests
- Cleaned up unused imports and updated
build.propertiesto sbt 1.11.2
Reviewed Changes
Copilot reviewed 19 out of 21 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/test/scala/org/virtuslab/beholder/repositories/* | Added DBIO imports and explicit return types for save/create |
| src/test/scala/org/virtuslab/beholder/model/* | Updated .<> syntax and removed unused imports |
| src/test/scala/org/virtuslab/beholder/json/* | Replaced __ \ 'field with __ \ Symbol("field") |
| src/test/scala/org/virtuslab/beholder/BaseTest.scala | Refactored Scalatest imports and fixture trait signature |
| src/main/scala/org/virtuslab/beholder/views/* | Added explicit return types and .<> syntax in views |
| src/main/scala/org/virtuslab/beholder/utils/ILikeExtension.scala | Added missing return types and updated view-bound to context bound |
| src/main/scala/org/virtuslab/beholder/filters/json/* | Converted Set diff, removed unused imports |
| src/main/scala/org/virtuslab/beholder/filters/* | Added explicit types and cleaned up redundant imports |
| project/build.properties | Updated sbt version from 1.8.2 to 1.11.2 |
| def save(elem: User) = baseUserBaseRepository.save(elem) | ||
|
|
||
| def create() = baseUserBaseRepository.create | ||
| import unicorn.profile.api.DBIO |
There was a problem hiding this comment.
[nitpick] Consider moving this import to the top of the file to keep imports organized and consistent with Scala style conventions.
|
|
||
| import scala.concurrent.ExecutionContext.Implicits.global | ||
|
|
||
| class LargeElementsRepository(val unicorn: UnicornPlay[Long]) extends LargeComponent with UnicornWrapper[Long] { | ||
| def save(elem: LargeElement) = baseLargeElementsRepository.save(elem) | ||
|
|
||
| def create() = baseLargeElementsRepository.create | ||
| import unicorn.profile.api.DBIO | ||
|
|
There was a problem hiding this comment.
[nitpick] Similarly, you may want to relocate this import to the file header for clarity and consistency.
src/test/scala/org/virtuslab/beholder/json/JsonFiltersVarLengthTest.scala
Outdated
Show resolved
Hide resolved
| import org.joda.time.DateTime | ||
| import org.scalatest._ | ||
| import org.scalatest.matchers.should.Matchers | ||
| import org.scalatest.{Matchers => _, _} |
There was a problem hiding this comment.
[nitpick] This complex wildcard import with an exclusion may be confusing—consider simplifying to only import needed traits to improve readability.
| import org.scalatest.{Matchers => _, _} | |
| import org.scalatest.flatspec.FixtureAnyFlatSpecLike | |
| import org.scalatest.Outcome |
…hTest.scala Suggested by Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| .replace("_", raw"\_") | ||
|
|
||
| implicit def iLikeExtension(c: Rep[String]) = new ILikeExtension(c) | ||
| implicit def iLikeExtension(c: Rep[String]): ILikeExtension[String] = new ILikeExtension(c) |
There was a problem hiding this comment.
We could setup scalafix for these things to be automatic
There was a problem hiding this comment.
Thanks for the idea, I'll look into it.
| @@ -399,7 +399,7 @@ trait FilterableViewsGenerateCodeComponent extends BaseViewComponent { | |||
| implicit val tupleShape = new TupleShape(s1, s2, s3, s4, s5, s6, s7, s8) | |||
| .asInstanceOf[Shape[_ <: FlatShapeLevel, (Rep[A1], Rep[A2], Rep[A3], Rep[A4], Rep[A5], Rep[A6], Rep[A7], Rep[A8]), (A1, A2, A3, A4, A5, A6, A7, A8), _]] | |||
|
|
|||
| def * = (c1, c2, c3, c4, c5, c6, c7, c8) <> (apply.tupled, unapply) | |||
| def * = (c1, c2, c3, c4, c5, c6, c7, c8).<>(apply.tupled, unapply) | |||
There was a problem hiding this comment.
Is this reported as a warning? Symbolic methods are usually fine without a dot
There was a problem hiding this comment.
~/devel/beholder/src/main/scala/org/virtuslab/beholder/views/FilterableViewsGenerateCodeComponent.scala:402:46
multiarg infix syntax looks like a tuple and will be deprecated
def * = (c1, c2, c3, c4, c5, c6, c7, c8) <> (apply.tupled, unapply)
Co-authored-by: Tomasz Godzik <tgodzik@users.noreply.github.com>
No description provided.