diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index f6f1e649e..d739727c8 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -3,3 +3,6 @@ aa7db3a42121f78a5b3bed3658786c1cef83efe8 # Enable scalafmt for Scala 3 64df4ae51873593a789af5848bd225c14d0baf8a + +# Scala Steward: Reformat with scalafmt 3.7.12 +e159c8e77d8bf7bba749fe95584c12272448c347 diff --git a/.scalafmt.conf b/.scalafmt.conf index 243e75f0e..2a58ea021 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version = "3.6.1" +version = "3.7.12" style = default maxColumn = 100 diff --git a/build.sbt b/build.sbt index 74fe2a9b7..179837f28 100644 --- a/build.sbt +++ b/build.sbt @@ -139,7 +139,7 @@ lazy val core = crossProject(JVMPlatform, JSPlatform, NativePlatform) .in(file("core")) .settings(commonSettings) .settings( - name := "scala-java-time", + name := "scala-java-time", libraryDependencies += ("org.portable-scala" %%% "portable-scala-reflect" % "1.1.2") .cross(CrossVersion.for3Use2_13) ) diff --git a/core/jvm/src/main/scala/org/threeten/bp/chrono/JapaneseEra.scala b/core/jvm/src/main/scala/org/threeten/bp/chrono/JapaneseEra.scala index 91f702817..f5638fc21 100644 --- a/core/jvm/src/main/scala/org/threeten/bp/chrono/JapaneseEra.scala +++ b/core/jvm/src/main/scala/org/threeten/bp/chrono/JapaneseEra.scala @@ -86,8 +86,8 @@ object JapaneseEra { * Obtains an instance of {@code JapaneseEra} from an {@code int} value. * * The {@link #SHOWA} era that contains 1970-01-01 (ISO calendar system) has the value 1 Later era - * is numbered 2 ({@link #HEISEI}). Earlier eras are numbered 0 ({@link #TAISHO}), - * -1 ({@link #MEIJI}), only Meiji and later eras are supported. + * is numbered 2 ({@link #HEISEI}). Earlier eras are numbered 0 ({@link #TAISHO}), -1 ({@link + * #MEIJI}), only Meiji and later eras are supported. * * @param japaneseEra * the era to represent diff --git a/core/shared/src/main/scala-2/org/threeten/bp/format/internal/TTBPDateTimeFormatterBuilder.scala b/core/shared/src/main/scala-2/org/threeten/bp/format/internal/TTBPDateTimeFormatterBuilder.scala index 77d3e484f..5cd5b0e96 100644 --- a/core/shared/src/main/scala-2/org/threeten/bp/format/internal/TTBPDateTimeFormatterBuilder.scala +++ b/core/shared/src/main/scala-2/org/threeten/bp/format/internal/TTBPDateTimeFormatterBuilder.scala @@ -282,8 +282,8 @@ object TTBPDateTimeFormatterBuilder { * @param signStyle * the positive/negative sign style, not null * @param subsequentWidth - * the width of subsequent non-negative numbers, 0 or greater, - * -1 if fixed width due to active adjacent parsing + * the width of subsequent non-negative numbers, 0 or greater, -1 if fixed width due to active + * adjacent parsing */ private[format] class NumberPrinterParser private[format] ( private[format] val field: TemporalField, diff --git a/core/shared/src/main/scala-2/org/threeten/bp/zone/ZoneMap.scala b/core/shared/src/main/scala-2/org/threeten/bp/zone/ZoneMap.scala index f4c6aa966..5e5a4267a 100644 --- a/core/shared/src/main/scala-2/org/threeten/bp/zone/ZoneMap.scala +++ b/core/shared/src/main/scala-2/org/threeten/bp/zone/ZoneMap.scala @@ -12,7 +12,7 @@ import scala.collection.immutable // TreeMap is not available in Scala.js however it is needed for Time Zone support // This is a simple implementation of NavigableMap, performance is likely terrible private[bp] class ZoneMap[K: ClassTag, V] private[bp] (var map: immutable.TreeMap[K, V])(implicit - ordering: Ordering[K] + ordering: Ordering[K] ) extends AbstractMap[K, V] with java.util.NavigableMap[K, V] { def this()(implicit ordering: Ordering[K]) = @@ -164,6 +164,6 @@ private[bp] class ZoneMap[K: ClassTag, V] private[bp] (var map: immutable.TreeMa object ZoneMap { def apply[K: ClassTag, V](map: immutable.TreeMap[K, V])(implicit - ordering: Ordering[K] + ordering: Ordering[K] ): java.util.NavigableMap[K, V] = new ZoneMap[K, V](map) } diff --git a/core/shared/src/main/scala-2/org/threeten/bp/zone/ZoneOffsetTransitionRule.scala b/core/shared/src/main/scala-2/org/threeten/bp/zone/ZoneOffsetTransitionRule.scala index c0d2defaf..6bbf04e0c 100644 --- a/core/shared/src/main/scala-2/org/threeten/bp/zone/ZoneOffsetTransitionRule.scala +++ b/core/shared/src/main/scala-2/org/threeten/bp/zone/ZoneOffsetTransitionRule.scala @@ -68,7 +68,7 @@ object ZoneOffsetTransitionRule { * @param dayOfMonthIndicator * the day of the month-day of the cutover week, positive if the week is that day or later, * negative if the week is that day or earlier, counting from the last day of the month, from - * -28 to 31 excluding 0 + * -28 to 31 excluding 0 * @param dayOfWeek * the required day-of-week, null if the month-day should not be changed * @param time diff --git a/core/shared/src/main/scala-3/org/threeten/bp/format/internal/TTBPDateTimeFormatterBuilder.scala b/core/shared/src/main/scala-3/org/threeten/bp/format/internal/TTBPDateTimeFormatterBuilder.scala index 876addf5e..1f917965d 100644 --- a/core/shared/src/main/scala-3/org/threeten/bp/format/internal/TTBPDateTimeFormatterBuilder.scala +++ b/core/shared/src/main/scala-3/org/threeten/bp/format/internal/TTBPDateTimeFormatterBuilder.scala @@ -279,8 +279,8 @@ object TTBPDateTimeFormatterBuilder { * @param signStyle * the positive/negative sign style, not null * @param subsequentWidth - * the width of subsequent non-negative numbers, 0 or greater, - * -1 if fixed width due to active adjacent parsing + * the width of subsequent non-negative numbers, 0 or greater, -1 if fixed width due to active + * adjacent parsing */ private[format] class NumberPrinterParser private[format] ( private[format] val field: TemporalField, diff --git a/core/shared/src/main/scala-3/org/threeten/bp/zone/ZoneOffsetTransitionRule.scala b/core/shared/src/main/scala-3/org/threeten/bp/zone/ZoneOffsetTransitionRule.scala index b10b69a5b..c0f122e10 100644 --- a/core/shared/src/main/scala-3/org/threeten/bp/zone/ZoneOffsetTransitionRule.scala +++ b/core/shared/src/main/scala-3/org/threeten/bp/zone/ZoneOffsetTransitionRule.scala @@ -68,7 +68,7 @@ object ZoneOffsetTransitionRule { * @param dayOfMonthIndicator * the day of the month-day of the cutover week, positive if the week is that day or later, * negative if the week is that day or earlier, counting from the last day of the month, from - * -28 to 31 excluding 0 + * -28 to 31 excluding 0 * @param dayOfWeek * the required day-of-week, null if the month-day should not be changed * @param time diff --git a/core/shared/src/main/scala/org/threeten/bp/LocalDate.scala b/core/shared/src/main/scala/org/threeten/bp/LocalDate.scala index c27f26473..e17fd9c8f 100644 --- a/core/shared/src/main/scala/org/threeten/bp/LocalDate.scala +++ b/core/shared/src/main/scala/org/threeten/bp/LocalDate.scala @@ -1598,8 +1598,7 @@ final class LocalDate private (private val year: Int, monthOfYear: Int, dayOfMon * * This checks to see if this date represents a point on the local time-line after the other date. *
LocalDate a = LocalDate.of(2012, 6, 30); LocalDate b = LocalDate.of(2012, 7, 1); - * a.isAfter(b) == false - * a.isAfter(a) == false b.isAfter(a) == true+ * a.isAfter(b) == false a.isAfter(a) == false b.isAfter(a) == true * * This method only considers the position of the two dates on the local time-line. It does not * take into account the chronology, or calendar system. This is different from the comparison in @@ -1619,8 +1618,7 @@ final class LocalDate private (private val year: Int, monthOfYear: Int, dayOfMon * * This checks to see if this date represents a point on the local time-line before the other * date.
LocalDate a = LocalDate.of(2012, 6, 30); LocalDate b = LocalDate.of(2012, 7, 1); - * a.isBefore(b) == true - * a.isBefore(a) == false b.isBefore(a) == false+ * a.isBefore(b) == true a.isBefore(a) == false b.isBefore(a) == false * * This method only considers the position of the two dates on the local time-line. It does not * take into account the chronology, or calendar system. This is different from the comparison in @@ -1640,8 +1638,7 @@ final class LocalDate private (private val year: Int, monthOfYear: Int, dayOfMon * * This checks to see if this date represents the same point on the local time-line as the other * date.
LocalDate a = LocalDate.of(2012, 6, 30); LocalDate b = LocalDate.of(2012, 7, 1); - * a.isEqual(b) == false - * a.isEqual(a) == true b.isEqual(a) == false+ * a.isEqual(b) == false a.isEqual(a) == true b.isEqual(a) == false * * This method only considers the position of the two dates on the local time-line. It does not * take into account the chronology, or calendar system. This is different from the comparison in diff --git a/core/shared/src/main/scala/org/threeten/bp/LocalDateTime.scala b/core/shared/src/main/scala/org/threeten/bp/LocalDateTime.scala index 8dfff04e3..b6c2120a3 100644 --- a/core/shared/src/main/scala/org/threeten/bp/LocalDateTime.scala +++ b/core/shared/src/main/scala/org/threeten/bp/LocalDateTime.scala @@ -1739,9 +1739,8 @@ final class LocalDateTime private (private val date: LocalDate, private val time * * This checks to see if this date-time represents a point on the local time-line after the other * date-time.
LocalDate a = LocalDateTime.of(2012, 6, 30, 12, 00); LocalDate b = - * LocalDateTime.of(2012, 7, 1, 12, 00); - * a.isAfter(b) == false - * a.isAfter(a) == false b.isAfter(a) == true+ * LocalDateTime.of(2012, 7, 1, 12, 00); a.isAfter(b) == false a.isAfter(a) == false b.isAfter(a) + * \== true * * This method only considers the position of the two date-times on the local time-line. It does * not take into account the chronology, or calendar system. This is different from the comparison @@ -1764,9 +1763,8 @@ final class LocalDateTime private (private val date: LocalDate, private val time * * This checks to see if this date-time represents a point on the local time-line before the other * date-time.
LocalDate a = LocalDateTime.of(2012, 6, 30, 12, 00); LocalDate b = - * LocalDateTime.of(2012, 7, 1, 12, 00); - * a.isBefore(b) == true - * a.isBefore(a) == false b.isBefore(a) == false+ * LocalDateTime.of(2012, 7, 1, 12, 00); a.isBefore(b) == true a.isBefore(a) == false + * b.isBefore(a) == false * * This method only considers the position of the two date-times on the local time-line. It does * not take into account the chronology, or calendar system. This is different from the comparison @@ -1789,9 +1787,8 @@ final class LocalDateTime private (private val date: LocalDate, private val time * * This checks to see if this date-time represents the same point on the local time-line as the * other date-time.
LocalDate a = LocalDateTime.of(2012, 6, 30, 12, 00); LocalDate b = - * LocalDateTime.of(2012, 7, 1, 12, 00); - * a.isEqual(b) == false - * a.isEqual(a) == true b.isEqual(a) == false+ * LocalDateTime.of(2012, 7, 1, 12, 00); a.isEqual(b) == false a.isEqual(a) == true b.isEqual(a) + * \== false * * This method only considers the position of the two date-times on the local time-line. It does * not take into account the chronology, or calendar system. This is different from the comparison diff --git a/core/shared/src/main/scala/org/threeten/bp/chrono/HijrahDate.scala b/core/shared/src/main/scala/org/threeten/bp/chrono/HijrahDate.scala index 5a882f5bd..fb96b074f 100644 --- a/core/shared/src/main/scala/org/threeten/bp/chrono/HijrahDate.scala +++ b/core/shared/src/main/scala/org/threeten/bp/chrono/HijrahDate.scala @@ -89,9 +89,9 @@ object HijrahDate { Array(30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 30) /** - *
Greatest Least Field name Minimum Minimum Maximum Maximum - * ---------- ------- ------- ------- ------- ERA 0 0 1 1 YEAR_OF_ERA 1 1 9999 9999 MONTH_OF_YEAR - * 1 1 12 12 DAY_OF_MONTH 1 1 29 30 DAY_OF_YEAR 1 1 354 355+ *
Greatest Least Field name Minimum Minimum Maximum Maximum ---------- ------- ------- + * ------- ------- ERA 0 0 1 1 YEAR_OF_ERA 1 1 9999 9999 MONTH_OF_YEAR 1 1 12 12 DAY_OF_MONTH 1 1 + * 29 30 DAY_OF_YEAR 1 1 354 355* * Minimum values. */ diff --git a/core/shared/src/main/scala/org/threeten/bp/chrono/package.scala b/core/shared/src/main/scala/org/threeten/bp/chrono/package.scala index e891fabde..d45968822 100644 --- a/core/shared/src/main/scala/org/threeten/bp/chrono/package.scala +++ b/core/shared/src/main/scala/org/threeten/bp/chrono/package.scala @@ -39,10 +39,10 @@ package org.threeten.bp * * The supported calendar systems includes: * - * -{@linkplain org.threeten.bp.chrono.HijrahChronology Hijrah calendar} - * -{@linkplain org.threeten.bp.chrono.JapaneseChronology Japanese calendar} - * -{@linkplain org.threeten.bp.chrono.MinguoChronology Minguo calendar} - * -{@linkplain org.threeten.bp.chrono.ThaiBuddhistChronology Thai Buddhist calendar} + * -{@linkplain org.threeten.bp.chrono.HijrahChronology Hijrah calendar} -{@linkplain + * org.threeten.bp.chrono.JapaneseChronology Japanese calendar} -{@linkplain + * org.threeten.bp.chrono.MinguoChronology Minguo calendar} -{@linkplain + * org.threeten.bp.chrono.ThaiBuddhistChronology Thai Buddhist calendar} * * It is intended that applications use the main API whenever possible, including code to read and * write from a persistent data store, such as a database, and to send dates and times across a diff --git a/core/shared/src/main/scala/org/threeten/bp/format/DateTimeFormatter.scala b/core/shared/src/main/scala/org/threeten/bp/format/DateTimeFormatter.scala index b3ddb6f53..9cb5888a5 100644 --- a/core/shared/src/main/scala/org/threeten/bp/format/DateTimeFormatter.scala +++ b/core/shared/src/main/scala/org/threeten/bp/format/DateTimeFormatter.scala @@ -440,10 +440,9 @@ object DateTimeFormatter { * DateTimeFormatter#withLocale(Locale)}. * * All letters 'A' to 'Z' and 'a' to 'z' are reserved as pattern letters. The following pattern - * letters are defined:
Symbol Meaning Presentation Examples
- * ------ ------- ------------ ------- G era number/text 1; 01; AD; Anno Domini y year year 2004;
- * 04 D day-of-year number 189 M month-of-year number/text 7; 07; Jul; July; J d day-of-month
- * number 10
+ * letters are defined: Symbol Meaning Presentation Examples ------ ------- ------------
+ * ------- G era number/text 1; 01; AD; Anno Domini y year year 2004; 04 D day-of-year number 189
+ * M month-of-year number/text 7; 07; Jul; July; J d day-of-month number 10
*
* Q quarter-of-year number/text 3; 03; Q3 Y week-based-year year 1996; 96 w week-of-year number
* 27 W week-of-month number 27 e localized day-of-week number 2; Tue; Tuesday; T E day-of-week
diff --git a/core/shared/src/main/scala/org/threeten/bp/format/DateTimeFormatterBuilder.scala b/core/shared/src/main/scala/org/threeten/bp/format/DateTimeFormatterBuilder.scala
index b5066dfe9..cda3e069c 100644
--- a/core/shared/src/main/scala/org/threeten/bp/format/DateTimeFormatterBuilder.scala
+++ b/core/shared/src/main/scala/org/threeten/bp/format/DateTimeFormatterBuilder.scala
@@ -1235,10 +1235,9 @@ final class DateTimeFormatterBuilder private (
*
* All letters 'A' to 'Z' and 'a' to 'z' are reserved as pattern letters. The characters '{' and
* '}' are reserved for future use. The characters '[' and ']' indicate optional patterns. The
- * following pattern letters are defined: Symbol Meaning Presentation Examples
- * ------ ------- ------------ ------- G era number/text 1; 01; AD; Anno Domini y year year 2004;
- * 04 D day-of-year number 189 M month-of-year number/text 7; 07; Jul; July; J d day-of-month
- * number 10
+ * following pattern letters are defined: Symbol Meaning Presentation Examples ------
+ * ------- ------------ ------- G era number/text 1; 01; AD; Anno Domini y year year 2004; 04 D
+ * day-of-year number 189 M month-of-year number/text 7; 07; Jul; July; J d day-of-month number 10
*
* Q quarter-of-year number/text 3; 03; Q3 Y week-based-year year 1996; 96 w week-of-year number
* 27 W week-of-month number 27 e localized day-of-week number 2; Tue; Tuesday; T E day-of-week
diff --git a/core/shared/src/main/scala/org/threeten/bp/zone/ZoneRulesBuilder.scala b/core/shared/src/main/scala/org/threeten/bp/zone/ZoneRulesBuilder.scala
index 91cbd3db2..3235200d7 100644
--- a/core/shared/src/main/scala/org/threeten/bp/zone/ZoneRulesBuilder.scala
+++ b/core/shared/src/main/scala/org/threeten/bp/zone/ZoneRulesBuilder.scala
@@ -553,7 +553,7 @@ class ZoneRulesBuilder() {
* the month of the transition, not null
* @param dayOfMonthIndicator
* the day-of-month of the transition, adjusted by dayOfWeek, from 1 to 31 adjusted later, or
- * -1 to -28 adjusted earlier from the last day of the month
+ * -1 to -28 adjusted earlier from the last day of the month
* @param dayOfWeek
* the day-of-week to adjust to, null if day-of-month should not be adjusted
* @param time
diff --git a/tests/shared/src/test/scala/org/threeten/bp/AssertionsHelper.scala b/tests/shared/src/test/scala/org/threeten/bp/AssertionsHelper.scala
index 2961d4963..0b62baf4e 100644
--- a/tests/shared/src/test/scala/org/threeten/bp/AssertionsHelper.scala
+++ b/tests/shared/src/test/scala/org/threeten/bp/AssertionsHelper.scala
@@ -17,27 +17,27 @@ trait AssertionsHelper { this: AnyFunSuite =>
true
def assertEquals[A, B](
- o1: A,
- o2: B,
- msg: String
+ o1: A,
+ o2: B,
+ msg: String
)(implicit prettifier: Prettifier, pos: source.Position): Assertion =
assert(o1 == o2, msg)
def assertEquals[A, B](
- o1: A,
- o2: B
+ o1: A,
+ o2: B
)(implicit prettifier: Prettifier, pos: source.Position): Assertion =
assert(o1 == o2)
def assertSame[A <: AnyRef, B <: AnyRef](
- o1: A,
- o2: B
+ o1: A,
+ o2: B
)(implicit prettifier: Prettifier, pos: source.Position): Assertion =
assert(o1 eq o2)
def assertNotEquals[A, B](
- o1: A,
- o2: B
+ o1: A,
+ o2: B
)(implicit prettifier: Prettifier, pos: source.Position): Assertion =
assert(o1 != o2)
@@ -51,8 +51,8 @@ trait AssertionsHelper { this: AnyFunSuite =>
assert(a == null)
def assertNotNull[A](
- a: A,
- msg: String
+ a: A,
+ msg: String
)(implicit prettifier: Prettifier, pos: source.Position): Assertion =
assert(a != null, msg)
diff --git a/tests/shared/src/test/scala/org/threeten/bp/TestInstant.scala b/tests/shared/src/test/scala/org/threeten/bp/TestInstant.scala
index b263dbb18..f7ba88da0 100644
--- a/tests/shared/src/test/scala/org/threeten/bp/TestInstant.scala
+++ b/tests/shared/src/test/scala/org/threeten/bp/TestInstant.scala
@@ -244,27 +244,27 @@ class TestInstant
List[Long](Long.MaxValue - 1,
0,
(Long.MaxValue - 1) / 1000,
- ((Long.MaxValue - 1) % 1000).toInt * 1000000
+ ((Long.MaxValue - 1) % 1000).toInt * 1000000
),
List[Long](Long.MinValue,
0,
(Long.MinValue / 1000) - 1,
- (Long.MinValue % 1000).toInt * 1000000 + 1000000000
+ (Long.MinValue % 1000).toInt * 1000000 + 1000000000
),
List[Long](Long.MinValue,
1,
(Long.MinValue / 1000) - 1,
- (Long.MinValue % 1000).toInt * 1000000 + 1000000000 + 1
+ (Long.MinValue % 1000).toInt * 1000000 + 1000000000 + 1
),
List[Long](Long.MinValue + 1,
0,
((Long.MinValue + 1) / 1000) - 1,
- ((Long.MinValue + 1) % 1000).toInt * 1000000 + 1000000000
+ ((Long.MinValue + 1) % 1000).toInt * 1000000 + 1000000000
),
List[Long](Long.MinValue + 1,
1,
((Long.MinValue + 1) / 1000) - 1,
- ((Long.MinValue + 1) % 1000).toInt * 1000000 + 1000000000 + 1
+ ((Long.MinValue + 1) % 1000).toInt * 1000000 + 1000000000 + 1
)
)
@@ -730,7 +730,7 @@ class TestInstant
0,
Long.MinValue,
Long.MinValue / 1000 - 1,
- (Long.MinValue % 1000).toInt * 1000000 + 1000000000
+ (Long.MinValue % 1000).toInt * 1000000 + 1000000000
)
)