Skip to content

Fixed compilation warnings#68

Open
odisseus wants to merge 5 commits intomasterfrom
upgrade
Open

Fixed compilation warnings#68
odisseus wants to merge 5 commits intomasterfrom
upgrade

Conversation

@odisseus
Copy link
Collaborator

@odisseus odisseus commented Jul 9, 2025

No description provided.

@odisseus odisseus requested a review from Copilot July 9, 2025 02:36
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 save and create methods in repositories
  • Replaced deprecated Slick tuple mapping syntax and Symbol literals in JSON tests
  • Cleaned up unused imports and updated build.properties to 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
Copy link

Copilot AI Jul 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider moving this import to the top of the file to keep imports organized and consistent with Scala style conventions.

Copilot uses AI. Check for mistakes.
Comment on lines 5 to +11

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

Copy link

Copilot AI Jul 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Similarly, you may want to relocate this import to the file header for clarity and consistency.

Copilot uses AI. Check for mistakes.
import org.joda.time.DateTime
import org.scalatest._
import org.scalatest.matchers.should.Matchers
import org.scalatest.{Matchers => _, _}
Copy link

Copilot AI Jul 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] This complex wildcard import with an exclusion may be confusing—consider simplifying to only import needed traits to improve readability.

Suggested change
import org.scalatest.{Matchers => _, _}
import org.scalatest.flatspec.FixtureAnyFlatSpecLike
import org.scalatest.Outcome

Copilot uses AI. Check for mistakes.
…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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could setup scalafix for these things to be automatic

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this reported as a warning? Symbolic methods are usually fine without a dot

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

~/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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants