Skip to content

Commit

Permalink
Merge pull request #16460 from lenguyenthanh/remove-unused/0
Browse files Browse the repository at this point in the history
Remove some unused imports, variables
  • Loading branch information
ornicar authored Nov 23, 2024
2 parents 666866c + f922d4d commit c285f46
Show file tree
Hide file tree
Showing 15 changed files with 6 additions and 27 deletions.
2 changes: 0 additions & 2 deletions app/controllers/Dasher.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ package controllers
import play.api.libs.json.*
import play.api.libs.ws.JsonBodyReadables.*
import play.api.libs.ws.StandaloneWSClient

import lila.app.{ *, given }
import lila.core.i18n.{ I18nKey as trans, defaultLang }
import lila.i18n.{ LangList, LangPicker }
import lila.pref.ui.DasherJson

Expand Down
2 changes: 0 additions & 2 deletions app/http/KeyPages.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package lila.app
package http

import play.api.libs.json.Json
import play.api.mvc.*

import lila.app.{ *, given }
import lila.memo.CacheApi.*

Expand Down
2 changes: 1 addition & 1 deletion app/mashup/Preload.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import lila.simul.{ Simul, SimulIsFeaturable }
import lila.streamer.LiveStreams
import lila.swiss.Swiss
import lila.timeline.Entry
import lila.tournament.{ Tournament, Winner }
import lila.tournament.Tournament
import lila.ublog.UblogPost
import lila.user.{ LightUserApi, Me, User }

Expand Down
1 change: 0 additions & 1 deletion app/mashup/UserInfo.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import play.api.data.Form
import lila.bookmark.BookmarkApi
import lila.core.data.SafeJsonStr
import lila.core.perf.UserWithPerfs
import lila.core.perm.Granter
import lila.core.user.User
import lila.forum.ForumPostApi
import lila.game.Crosstable
Expand Down
1 change: 0 additions & 1 deletion app/views/lobby/bits.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package views.lobby

import lila.app.UiEnv.{ *, given }
import lila.rating.PerfType

object bits:

Expand Down
3 changes: 1 addition & 2 deletions app/views/mod/communication.scala
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package views.mod

import lila.app.UiEnv.{ *, given }
import lila.common.String.html.richText
import lila.core.shutup.PublicSource
import lila.mod.IpRender.RenderIp
import lila.mod.UserWithModlog
import lila.shutup.{ Analyser, PublicLine }
import lila.shutup.Analyser

def publicLineSource(source: lila.core.shutup.PublicSource)(using Translate): Frag = source match
case PublicSource.Tournament(id) => views.tournament.ui.tournamentLink(id)
Expand Down
1 change: 0 additions & 1 deletion app/views/mod/inquiry.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package views.mod

import lila.app.UiEnv.{ *, given }
import lila.core.id.{ ForumPostId, RelayRoundId }
import lila.report.Report
import lila.shutup.Analyser

Expand Down
2 changes: 0 additions & 2 deletions app/views/user/mod.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package views.user

import lila.app.UiEnv.{ *, given }
import lila.appeal.Appeal
import lila.core.i18n.Translate
import lila.mod.IpRender.RenderIp
import lila.mod.UserWithModlog
import lila.mod.ui.{ mzSection, ModUserTableUi }
Expand All @@ -11,7 +10,6 @@ import lila.security.{ Dated, UserAgentParser, UserClient, UserLogins }
object mod:

import views.mod.user.*
import views.mod.{ user as ui }

def student(managed: lila.clas.Student.ManagedInfo)(using Context): Frag =
mzSection("student")(
Expand Down
1 change: 0 additions & 1 deletion app/views/user/show/page.scala
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ object page:
)

private def esModules(withSearch: Boolean = false)(using Context): EsmList =
import play.api.libs.json.Json
infiniteScrollEsmInit
++ esmInit("bits.user")
++ withSearch.so(Esm("bits.gameSearch"))
Expand Down
4 changes: 1 addition & 3 deletions modules/api/src/main/ModTimeline.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package lila.api

import java.time.LocalDate

import lila.mod.{ Modlog, ModlogApi }
import lila.appeal.{ Appeal, AppealMsg, AppealApi }
import lila.user.{ Note, NoteApi }
Expand All @@ -20,7 +18,7 @@ case class ModTimeline(
playbanRecord: Option[lila.playban.UserRecord],
flaggedPublicLines: List[PublicLine]
):
import ModTimeline.{ *, given }
import ModTimeline.*

lazy val all: List[Event] =
val reportEvents: List[Event] = reports.flatMap(reportAtoms)
Expand Down
8 changes: 1 addition & 7 deletions modules/api/src/main/ui/ModTimelineUi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,16 @@ import ScalatagsTemplate.{ *, given }
import lila.mod.Modlog
import lila.appeal.AppealMsg
import lila.user.Note
import lila.report.Report
import lila.playban.TempBan
import java.time.LocalDate
import lila.core.config.NetDomain
import lila.core.userId.ModId
import lila.shutup.{ PublicLine, Analyser }
import lila.core.shutup.PublicSource
import lila.core.i18n.Translate
import lila.core.id.RelayRoundId

final class ModTimelineUi(helpers: Helpers)(
publicLineSource: PublicSource => Translate ?=> Frag
)(using NetDomain):
import helpers.{ *, given }
import helpers.*
import ModTimeline.*

def renderGeneral(t: ModTimeline)(using Translate) = render(t)(using Angle.None)
Expand Down Expand Up @@ -103,8 +99,6 @@ final class ModTimelineUi(helpers: Helpers)(

private def renderReportNew(r: ReportNewAtom)(using Translate) =
import r.*
val reporters = r.atoms.toList.map: atom =>
userIdLink(atom.by.some, withOnline = false)
frag(
if r.atoms.size == 1 && r.atoms.forall(_.by.is(UserId.lichess))
then renderMod(UserId.lichess.into(ModId))
Expand Down
2 changes: 1 addition & 1 deletion modules/chat/src/main/ChatUi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import lila.ui.*
import ScalatagsTemplate.{ *, given }

final class ChatUi(helpers: Helpers):
import helpers.{ *, given }
import helpers.*

val frag = st.section(cls := "mchat")(
div(cls := "mchat__tabs")(
Expand Down
1 change: 0 additions & 1 deletion modules/core/src/main/rating.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package lila.core
package rating

import alleycats.Zero
import _root_.chess.IntRating
import _root_.chess.rating.IntRatingDiff

Expand Down
2 changes: 1 addition & 1 deletion modules/mod/src/main/ui/ModInquiryUi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package lila.mod
package ui

import lila.core.config.NetDomain
import lila.report.{ Reason, Report }
import lila.report.Report
import lila.ui.*

import ScalatagsTemplate.{ *, given }
Expand Down
1 change: 0 additions & 1 deletion modules/user/src/main/UserForm.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import lila.common.Form.{
cleanNoSymbolsAndNonEmptyText,
cleanNoSymbolsText,
cleanNonEmptyText,
cleanText,
cleanTextWithSymbols,
into,
playerTitle
Expand Down

0 comments on commit c285f46

Please sign in to comment.