Skip to content

Commit

Permalink
update dependencies (#1472)
Browse files Browse the repository at this point in the history
  • Loading branch information
brharrington authored Oct 13, 2022
2 parents 8044337 + d0671b6 commit 72cadea
Show file tree
Hide file tree
Showing 134 changed files with 624 additions and 455 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ jobs:
runs-on: macos-latest
strategy:
matrix:
java: [17, 18]
scala: [2.13.8]
java: [17, 19]
scala: [2.13.10]
steps:
- uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.java }}
Expand Down
28 changes: 24 additions & 4 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,17 +1,37 @@
version = 2.3.2
version = 3.5.9
runner.dialect = scala213

style = defaultWithAlign

align.openParenCallSite = false
align.openParenDefnSite = false
align.tokens = [{code = "->"}, {code = "<-"}, {code = "=>", owner = "Case"}]

continuationIndent.callSite = 2
continuationIndent.defnSite = 2
danglingParentheses = true

danglingParentheses.preset = true

docstrings.style = keep

indentOperator = spray
indentOperator.excludeRegex = "^(&&|\\|\\||~)$"
indentOperator.exemptScope = all

literals.hexDigits = Upper

maxColumn = 100
newlines.alwaysBeforeTopLevelStatements = true

newlines.afterCurlyLambdaParams = keep
newlines.beforeCurlyLambdaParams = multilineWithCaseOnly
newlines.inInterpolation = oneline
newlines.topLevelBodyIfMinStatements = [before]
newlines.topLevelStatementBlankLines = [
{ blanks { before = 1, after = 0 } }
]

project.excludeFilters = [".*\\.sbt"]

rewrite.rules = [RedundantParens, ExpandImportSelectors, AvoidInfix]

spaces.inImportCurlyBraces = false
unindentTopLevelOperators = true
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import akka.util.ByteString
* can be used to avoid allocating a temporary array and using `ByteArrayInputStream`.
*/
class ByteStringInputStream(data: ByteString) extends InputStream {

private val buffers = data.asByteBuffers.iterator
private var current = buffers.next()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ object ClusterOps extends StrictLogging {
}
}
.recoverWithRetries(
-1, {
-1,
{
// Ignore non-fatal failure that may happen when a member is removed from cluster
case e: Exception => {
logger.debug(s"suppressing failure for: $m", e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ object CustomDirectives {

// Magic header to recognize GZIP compressed data
// http://www.zlib.org/rfc-gzip.html#file-format
private val gzipMagicHeader = ByteString(Array(0x1f.toByte, 0x8b.toByte))
private val gzipMagicHeader = ByteString(Array(0x1F.toByte, 0x8B.toByte))

/**
* Create an InputStream for reading the content of the ByteString. If the data is
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import akka.http.scaladsl.model.StatusCode
import com.netflix.atlas.json.JsonSupport

object DiagnosticMessage {

final val Info: String = "info"
final val Warning: String = "warn"
final val Error: String = "error"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ object UnboundedMeteredMailbox {
private val registry = Spectator.globalRegistry()
private val insertCounter = registry.counter("akka.queue.insert", "path", path)
private val waitTimer = registry.timer("akka.queue.wait", "path", path)

PolledMeter
.using(registry)
.withName("akka.queue.size")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ object WebServer {
secure: Boolean,
contextFactory: ConnectionContextFactory = null
) {

require(!secure || contextFactory != null, s"context is not set for secure port $port")

def createConnectionContext: HttpsConnectionContext = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class ConnectionContextFactorySuite extends FunSuite {
object ConnectionContextFactorySuite {

class EmptyConstructorFactory extends ConnectionContextFactory {

override def sslContext: SSLContext = null

override def sslEngine: SSLEngine = null
Expand All @@ -64,6 +65,7 @@ object ConnectionContextFactorySuite {
}

class ConfigConstructorFactory(config: Config) extends ConnectionContextFactory {

require(config.getBoolean("correct-subconfig"))

override def sslContext: SSLContext = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,15 @@ class DeadLetterStatsActorSuite extends FunSuite with TestKitBase with ImplicitS
private val recipient = newRef("to")

private def newRef(name: String): ActorRef = {
val r = system.actorOf(Props(new Actor {
val r = system.actorOf(
Props(new Actor {

override def receive: Receive = {
case _ =>
}
}), name)
override def receive: Receive = {
case _ =>
}
}),
name
)
system.stop(r)
r
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class HealthcheckApiSuite extends MUnitRouteSuite {
private val serviceHealth = new AtomicBoolean(false)

val services = new java.util.HashSet[Service]

services.add(new Service {

override def state(): State = State.RUNNING
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package com.netflix.atlas.chart
import com.netflix.iep.config.ConfigManager

object GraphConstants {

private final val config = ConfigManager.dynamicConfig().getConfig("atlas.chart.limits")
final val MaxYAxis = config.getInt("max-yaxes")
final val MaxLinesInLegend = config.getInt("max-lines-in-legend")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import com.netflix.atlas.chart.model.GraphDef
import com.netflix.atlas.chart.util.PngImage

trait PngGraphEngine extends GraphEngine {

val contentType: String = "image/png"

def write(config: GraphDef, output: OutputStream): Unit = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,13 @@ object ChartSettings {
if (!config.hasPath(s"theme.$name")) {
throw new IllegalArgumentException(s"invalid theme name: '$name'")
} else {
themes.computeIfAbsent(name, n => {
val c = config.getConfig(s"theme.$n")
Theme(c)
})
themes.computeIfAbsent(
name,
n => {
val c = config.getConfig(s"theme.$n")
Theme(c)
}
)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ case class Legend(
private val numEntries = plot.data.size

private val header = HorizontalPadding(5) :: label.toList.map { str =>
val bold = ChartSettings.normalFont.deriveFont(Font.BOLD)
val headerColor = plot.getAxisColor(styles.text.color)
Text(str, font = bold, alignment = TextAlignment.LEFT, style = Style(headerColor))
}
val bold = ChartSettings.normalFont.deriveFont(Font.BOLD)
val headerColor = plot.getAxisColor(styles.text.color)
Text(str, font = bold, alignment = TextAlignment.LEFT, style = Style(headerColor))
}

private val entries = plot.data.take(maxEntries).flatMap { data =>
List(HorizontalPadding(2), LegendEntry(styles, plot, data, showStats))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ case class TimeSeriesGraph(graphDef: GraphDef) extends Element with FixedHeight
end,
graphDef.step,
tz,
if (i == 0) 40 else 0xff
if (i == 0) 40 else 0xFF
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ case class Palette(name: String, colors: Int => Color) {
}

def iterator: Iterator[Color] = new Iterator[Color] {

private var pos = -1

override def hasNext: Boolean = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ case class PlotDef(
def bounds(start: Long, end: Long): (Double, Double) = {

val dataLines = lines
if (dataLines.isEmpty) (0.0 -> 1.0)
if (dataLines.isEmpty) 0.0 -> 1.0
else {
val step = dataLines.head.data.data.step
val (regular, stacked) = dataLines
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,33 +56,35 @@ class GraphAssertions(goldenDir: String, targetDir: String, assert: (Any, Any) =
val report = s"""<html>
<head><title>${clazz.getSimpleName}</title></head>
<body><h1>${clazz.getSimpleName}</h1><hr/> ${
val dir = new File(targetDir)
dir.mkdirs()
dir.listFiles
.filter(_.getName.endsWith(".png"))
.filterNot(_.getName.startsWith("diff_"))
.map { f =>
val diffImg = new File(s"$targetDir/diff_${f.getName}")
if (diffsOnly && !diffImg.isFile) ""
else {
s"""<div>
val dir = new File(targetDir)
dir.mkdirs()
dir.listFiles
.filter(_.getName.endsWith(".png"))
.filterNot(_.getName.startsWith("diff_"))
.map { f =>
val diffImg = new File(s"$targetDir/diff_${f.getName}")
if (diffsOnly && !diffImg.isFile) ""
else {
s"""<div>
<h2>${f.getName}</h2>
<table border="1">
<tr><th>Golden</th><th>Test</th><th>Diff</th></tr>
<tr valign="top">
<td><img src="${absoluteGoldenDir + '/' + f.getName}"/></td>
<td><img src="${f.getName}"/></td>
${if (diffImg.isFile)
s"""<td><img src="${s"diff_${f.getName}"}"/></td>"""
else
"""<td></td>"""}
${
if (diffImg.isFile)
s"""<td><img src="${s"diff_${f.getName}"}"/></td>"""
else
"""<td></td>"""
}
</tr>
</table>
</div>"""
}
}
}
.mkString("")
} </body>
.mkString("")
} </body>
</html>"""

Using.resource(Streams.fileOut(new File(s"$targetDir/report.html"))) { out =>
Expand Down
Loading

0 comments on commit 72cadea

Please sign in to comment.