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.6.1 #414

Merged
merged 3 commits into from
Nov 12, 2022
Merged
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.6.1
aa7db3a42121f78a5b3bed3658786c1cef83efe8
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "3.5.9"
version = "3.6.1"
style = default

maxColumn = 100
Expand Down
4 changes: 2 additions & 2 deletions core/js/src/main/scala/java/util/SimpleTimeZone.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package java.util

class SimpleTimeZone(rawOffset: Int, var ID: String) extends TimeZone {
override def getRawOffset = rawOffset
override def getRawOffset = rawOffset
/* concrete methods */
override def getID: String = ID
override def getID: String = ID
override def setID(id: String): Unit = ID = id

}
6 changes: 3 additions & 3 deletions core/js/src/main/scala/java/util/TimeZone.scala
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ object TimeZone {
new SimpleTimeZone(offsetInMillis, timeZone)
}

def getDefault: TimeZone = default
def getDefault: TimeZone = default
def setDefault(timeZone: TimeZone): Unit = default = timeZone

def getTimeZone(timeZone: String): TimeZone = getTimeZone(ZoneId.of(timeZone))
def getTimeZone(zoneId: ZoneId): TimeZone = {
def getTimeZone(zoneId: ZoneId): TimeZone = {
val rules = zoneId.getRules
val offsetInMillis = rules.getStandardOffset(Instant.now).getTotalSeconds * 1000
new SimpleTimeZone(offsetInMillis, zoneId.getId)
Expand All @@ -80,7 +80,7 @@ abstract class TimeZone extends Serializable with Cloneable {
// def useDaylightTime: Boolean

/* concrete methods */
def getID: String = ID
def getID: String = ID
def setID(id: String): Unit = ID = id

def getDisplayName(daylight: Boolean, style: Int, locale: Locale): String = {
Expand Down
4 changes: 2 additions & 2 deletions core/native/src/main/scala/java/util/SimpleTimeZone.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package java.util

class SimpleTimeZone(rawOffset: Int, var ID: String) extends TimeZone {
override def getRawOffset = rawOffset
override def getRawOffset = rawOffset
/* concrete methods */
override def getID: String = ID
override def getID: String = ID
override def setID(id: String): Unit = ID = id

}
6 changes: 3 additions & 3 deletions core/native/src/main/scala/java/util/TimeZone.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ object TimeZone {
// TODO: implement this functionality, perhaps using https://github.com/scala-native/scala-native/blob/master/posixlib/src/main/scala/scala/scalanative/posix/time.scala
new SimpleTimeZone(0, "UTC")

def getDefault: TimeZone = default
def getDefault: TimeZone = default
def setDefault(timeZone: TimeZone): Unit = default = timeZone

def getTimeZone(timeZone: String): TimeZone = getTimeZone(ZoneId.of(timeZone))
def getTimeZone(zoneId: ZoneId): TimeZone = {
def getTimeZone(zoneId: ZoneId): TimeZone = {
val rules = zoneId.getRules
val offsetInMillis = rules.getStandardOffset(Instant.now).getTotalSeconds * 1000
new SimpleTimeZone(offsetInMillis, zoneId.getId)
Expand All @@ -42,7 +42,7 @@ abstract class TimeZone extends Serializable with Cloneable {
// def useDaylightTime: Boolean

/* concrete methods */
def getID: String = ID
def getID: String = ID
def setID(id: String): Unit = ID = id

def getDisplayName(daylight: Boolean, style: Int, locale: Locale): String = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,13 +259,13 @@ object IsoFields {
private def QY = "QuarterOfYear"

lazy val QUARTER_OF_YEAR: Field = new Field("QUARTER_OF_YEAR", 1) {
override def toString: String = QY
def getBaseUnit: TemporalUnit = QUARTER_YEARS
def getRangeUnit: TemporalUnit = YEARS
def range: ValueRange = ValueRange.of(1, 4)
def isSupportedBy(temporal: TemporalAccessor): Boolean =
override def toString: String = QY
def getBaseUnit: TemporalUnit = QUARTER_YEARS
def getRangeUnit: TemporalUnit = YEARS
def range: ValueRange = ValueRange.of(1, 4)
def isSupportedBy(temporal: TemporalAccessor): Boolean =
temporal.isSupported(MONTH_OF_YEAR) && isIso(temporal)
def rangeRefinedBy(temporal: TemporalAccessor): ValueRange = range
def rangeRefinedBy(temporal: TemporalAccessor): ValueRange = range
def getFrom(temporal: TemporalAccessor): Long = {
if (!temporal.isSupported(this))
throw unsupportedEx(QY)
Expand Down Expand Up @@ -349,13 +349,13 @@ object IsoFields {
new UnsupportedTemporalTypeException(s"Unsupported field: $f")

lazy val WEEK_BASED_YEAR: Field = new Field("WEEK_BASED_YEAR", 3) {
override def toString: String = WBY
def getBaseUnit: TemporalUnit = WEEK_BASED_YEARS
def getRangeUnit: TemporalUnit = FOREVER
def range: ValueRange = YEAR.range
def isSupportedBy(temporal: TemporalAccessor): Boolean =
override def toString: String = WBY
def getBaseUnit: TemporalUnit = WEEK_BASED_YEARS
def getRangeUnit: TemporalUnit = FOREVER
def range: ValueRange = YEAR.range
def isSupportedBy(temporal: TemporalAccessor): Boolean =
temporal.isSupported(EPOCH_DAY) && isIso(temporal)
def rangeRefinedBy(temporal: TemporalAccessor): ValueRange = YEAR.range
def rangeRefinedBy(temporal: TemporalAccessor): ValueRange = YEAR.range
def getFrom(temporal: TemporalAccessor): Long =
if (!temporal.isSupported(this))
throw unsupportedEx(WBY)
Expand Down
2 changes: 1 addition & 1 deletion core/shared/src/main/scala/org/threeten/bp/ZoneId.scala
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ abstract class ZoneId private[bp] () extends Serializable {
.appendZoneText(style)
.toFormatter(locale)
.format(new TemporalAccessor() {
def isSupported(field: TemporalField): Boolean = false
def isSupported(field: TemporalField): Boolean = false
def getLong(field: TemporalField): Long =
throw new UnsupportedTemporalTypeException(s"Unsupported field: $field")
override def query[R](query: TemporalQuery[R]): R =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,18 @@ object MockFieldNoValue {
final class MockFieldNoValue(name: String, ordinal: Int)
extends Enum[MockFieldNoValue](name, ordinal)
with TemporalField {
override def toString: String = null
def getBaseUnit: TemporalUnit = WEEKS
def getRangeUnit: TemporalUnit = MONTHS
def range: ValueRange = ValueRange.of(1, 20)
def isDateBased: Boolean = true
def isTimeBased: Boolean = false
def isSupportedBy(dateTime: TemporalAccessor): Boolean = true
def rangeRefinedBy(dateTime: TemporalAccessor): ValueRange = ValueRange.of(1, 20)
def getFrom(dateTime: TemporalAccessor): Long = throw new DateTimeException("Mock")
override def toString: String = null
def getBaseUnit: TemporalUnit = WEEKS
def getRangeUnit: TemporalUnit = MONTHS
def range: ValueRange = ValueRange.of(1, 20)
def isDateBased: Boolean = true
def isTimeBased: Boolean = false
def isSupportedBy(dateTime: TemporalAccessor): Boolean = true
def rangeRefinedBy(dateTime: TemporalAccessor): ValueRange = ValueRange.of(1, 20)
def getFrom(dateTime: TemporalAccessor): Long = throw new DateTimeException("Mock")
def adjustInto[R <: Temporal](dateTime: R, newValue: Long): R =
throw new DateTimeException("Mock")
override def getDisplayName(locale: Locale): String = "Mock"
override def getDisplayName(locale: Locale): String = "Mock"
override def resolve(
fieldValues: java.util.Map[TemporalField, java.lang.Long],
partialTemporal: TemporalAccessor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ import org.threeten.bp.format.internal.TTBPDateTimePrintContext
/** Abstract PrinterParser test. */
object GenTestPrinterParser {
private val EMPTY: TemporalAccessor = new TemporalAccessor() {
def isSupported(field: TemporalField): Boolean = true
def getLong(field: TemporalField): Long = throw new DateTimeException("Mock")
override def get(field: TemporalField): Int =
def isSupported(field: TemporalField): Boolean = true
def getLong(field: TemporalField): Long = throw new DateTimeException("Mock")
override def get(field: TemporalField): Int =
range(field).checkValidIntValue(getLong(field), field)
override def query[R](query: TemporalQuery[R]): R = query.queryFrom(this)
override def range(field: TemporalField): ValueRange = field.range
override def query[R](query: TemporalQuery[R]): R = query.queryFrom(this)
override def range(field: TemporalField): ValueRange = field.range
}
}

Expand Down