Skip to content
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

Update scalafmt-core to 3.8.4 #189

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Scala Steward: Reformat with scalafmt 3.8.4
14269d8b09d7231bdeb74295f40dc5eb105ee474
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "3.8.1"
version = "3.8.4"

runner.dialect = "scala3"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,26 @@ final class CustomerRowWriter(testTransactor: MySqlTestTransactor)
with RowWriter[CustomerRow]:
override def add(rows: List[CustomerRow]): IO[Unit] = super.add(
rows,
row => s"""INSERT INTO customer (
| customer_id,
| store_id,
| first_name,
| last_name,
| email,
| address_id,
| active,
| create_date
|) VALUES (
| ${row.customer_id},
| ${row.store_id},
| '${row.first_name}',
| '${row.last_name}',
| '${row.email}',
| ${row.address_id},
| ${if row.active then 1 else 0},
| '${row.create_date.format(dateTimeFormatter)}'
|)""".stripMargin,
row =>
s"""INSERT INTO customer (
| customer_id,
| store_id,
| first_name,
| last_name,
| email,
| address_id,
| active,
| create_date
|) VALUES (
| ${row.customer_id},
| ${row.store_id},
| '${row.first_name}',
| '${row.last_name}',
| '${row.email}',
| ${row.address_id},
| ${if row.active then 1 else 0},
| '${row.create_date.format(dateTimeFormatter)}'
|)""".stripMargin,
)

object CustomerRowWriter:
Expand Down
55 changes: 28 additions & 27 deletions apps/operations/src/test/scala/movies/writers/FilmRowWriter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,34 @@ final class FilmRowWriter(testTransactor: MySqlTestTransactor)
with RowWriter[FilmRow]:
override def add(rows: List[FilmRow]): IO[Unit] = super.add(
rows,
row => s"""INSERT INTO film (
| film_id,
| title,
| description,
| release_year,
| language_id,
| original_language_id,
| rental_duration,
| rental_rate,
| length,
| replacement_cost,
| rating,
| special_features
|) VALUES (
| ${row.film_id},
| '${row.title}',
| ${row.description.fold("NULL")(x => s"'$x'")},
| ${row.release_year},
| ${row.language_id},
| ${row.original_language_id.getOrElse("NULL")},
| ${row.rental_duration},
| '${row.rental_rate}',
| ${row.length.getOrElse("NULL")},
| '${row.replacement_cost}',
| '${row.rating.name}',
| ${row.special_features.fold("NULL")(x => s"'$x'")}
|)""".stripMargin,
row =>
s"""INSERT INTO film (
| film_id,
| title,
| description,
| release_year,
| language_id,
| original_language_id,
| rental_duration,
| rental_rate,
| length,
| replacement_cost,
| rating,
| special_features
|) VALUES (
| ${row.film_id},
| '${row.title}',
| ${row.description.fold("NULL")(x => s"'$x'")},
| ${row.release_year},
| ${row.language_id},
| ${row.original_language_id.getOrElse("NULL")},
| ${row.rental_duration},
| '${row.rental_rate}',
| ${row.length.getOrElse("NULL")},
| '${row.replacement_cost}',
| '${row.rating.name}',
| ${row.special_features.fold("NULL")(x => s"'$x'")}
|)""".stripMargin,
)

object FilmRowWriter:
Expand Down
31 changes: 16 additions & 15 deletions apps/operations/src/test/scala/movies/writers/RentalRowWriter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,22 @@ final class RentalRowWriter(testTransactor: MySqlTestTransactor)
with RowWriter[RentalRow]:
override def add(rows: List[RentalRow]): IO[Unit] = super.add(
rows,
row => s"""INSERT INTO rental (
| rental_id,
| rental_date,
| inventory_id,
| customer_id,
| return_date,
| staff_id
|) VALUES (
| ${row.rental_id},
| '${row.rental_date.format(dateTimeFormatter)}',
| ${row.inventory_id},
| ${row.customer_id},
| ${row.return_date.fold("NULL")(x => s"'${x.format(dateTimeFormatter)}'")},
| ${row.staff_id}
|)""".stripMargin,
row =>
s"""INSERT INTO rental (
| rental_id,
| rental_date,
| inventory_id,
| customer_id,
| return_date,
| staff_id
|) VALUES (
| ${row.rental_id},
| '${row.rental_date.format(dateTimeFormatter)}',
| ${row.inventory_id},
| ${row.customer_id},
| ${row.return_date.fold("NULL")(x => s"'${x.format(dateTimeFormatter)}'")},
| ${row.staff_id}
|)""".stripMargin,
)

object RentalRowWriter:
Expand Down
49 changes: 25 additions & 24 deletions apps/operations/src/test/scala/movies/writers/StaffRowWriter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,31 @@ final class StaffRowWriter(testTransactor: MySqlTestTransactor)
with RowWriter[StaffRow]:
override def add(rows: List[StaffRow]): IO[Unit] = super.add(
rows,
row => s"""INSERT INTO staff (
| staff_id,
| first_name,
| last_name,
| address_id,
| picture,
| email,
| store_id,
| active,
| username,
| password
|) VALUES (
| ${row.staff_id},
| '${row.first_name}',
| '${row.last_name}',
| ${row.address_id},
| null,
| '${row.email}',
| ${row.store_id},
| ${if row.active then 1 else 0},
| '${row.username}',
| '${row.password}'
|)
|""".stripMargin,
row =>
s"""INSERT INTO staff (
| staff_id,
| first_name,
| last_name,
| address_id,
| picture,
| email,
| store_id,
| active,
| username,
| password
|) VALUES (
| ${row.staff_id},
| '${row.first_name}',
| '${row.last_name}',
| ${row.address_id},
| null,
| '${row.email}',
| ${row.store_id},
| ${if row.active then 1 else 0},
| '${row.username}',
| '${row.password}'
|)
|""".stripMargin,
)

object StaffRowWriter:
Expand Down
9 changes: 3 additions & 6 deletions libs/commons/src/main/scala/Log4sLogger.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,15 @@ object Log4sLogger:

@inline override def isDebugEnabled: IO[Boolean] = IO.pure(logLevel match
case Debug | Trace => true
case _ => false,
)
case _ => false)

@inline override def isInfoEnabled: IO[Boolean] = IO.pure(logLevel match
case Debug | Trace | Info => true
case _ => false,
)
case _ => false)

@inline override def isWarnEnabled: IO[Boolean] = IO.pure(logLevel match
case Debug | Trace | Info | Warn => true
case _ => false,
)
case _ => false)

@inline override def isErrorEnabled: IO[Boolean] = IO.pure(true)

Expand Down
Loading