Skip to content
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.11.5
3fa53c1bd550894a70bf45345e7df79057783a79
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = 3.6.1
version = 3.11.5
runner.dialect = scala3
project.git = true
maxColumn = 120
Expand Down
18 changes: 9 additions & 9 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,25 @@ val username = "RustedBones"
val repo = "scout"

// for sbt-github-actions
ThisBuild / scalaVersion := "3.2.1"
ThisBuild / scalaVersion := "3.2.1"
ThisBuild / githubWorkflowBuild := Seq(
WorkflowStep.Sbt(name = Some("Check project"), commands = List("scalafmtCheckAll", "headerCheckAll")),
WorkflowStep.Sbt(name = Some("Build project"), commands = List("test", "IntegrationTest/test"))
)
ThisBuild / githubWorkflowTargetBranches := Seq("main")
ThisBuild / githubWorkflowTargetBranches := Seq("main")
ThisBuild / githubWorkflowPublishTargetBranches := Seq.empty

lazy val commonSettings = Defaults.itSettings ++
headerSettings(Configurations.IntegrationTest) ++
inConfig(IntegrationTest)(ScalafmtPlugin.scalafmtConfigSettings) ++
Seq(
organization := "fr.davit",
organization := "fr.davit",
organizationName := "Michel Davit",
scalaVersion := (ThisBuild / scalaVersion).value,
homepage := Some(url(s"https://github.com/$username/$repo")),
scalaVersion := (ThisBuild / scalaVersion).value,
homepage := Some(url(s"https://github.com/$username/$repo")),
licenses += ("Apache-2.0", new URL("https://www.apache.org/licenses/LICENSE-2.0.txt")),
startYear := Some(2020),
scmInfo := Some(ScmInfo(url(s"https://github.com/$username/$repo"), s"git@github.com:$username/$repo.git")),
startYear := Some(2020),
scmInfo := Some(ScmInfo(url(s"https://github.com/$username/$repo"), s"git@github.com:$username/$repo.git")),
developers := List(
Developer(
id = s"$username",
Expand All @@ -34,9 +34,9 @@ lazy val commonSettings = Defaults.itSettings ++
url = url(s"https://github.com/$username")
)
),
publishMavenStyle := true,
publishMavenStyle := true,
Test / publishArtifact := false,
publishTo := {
publishTo := {
val resolver = if (isSnapshot.value) {
Opts.resolver.sonatypeSnapshots: @nowarn("cat=deprecation")
} else {
Expand Down
12 changes: 4 additions & 8 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import sbt._
import sbt.*

object Dependencies {
object Dependencies:

object Versions {
object Versions:
val MUnitCE3 = "1.0.7"
val Taxonomy = "1.2.1"
}

val Taxonomy = "fr.davit" %% "taxonomy-fs2" % Versions.Taxonomy

object Test {
object Test:
val MUnitCE3 = "org.typelevel" %% "munit-cats-effect-3" % Versions.MUnitCE3 % "it,test"
}

}
2 changes: 1 addition & 1 deletion project/sbt-release.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0")
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0")
6 changes: 3 additions & 3 deletions src/main/scala/fr/davit/scout/Zeroconf.scala
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ object Zeroconf:
): Stream[F, Unit] =

def isServiceRequest(message: DnsMessage): Boolean =
val isQuery = message.header.`type` == DnsType.Query
val isQuery = message.header.`type` == DnsType.Query
val isServiceQuestion = message.questions.exists { q =>
q.name == instance.service.show &&
q.`type` == DnsRecordType.PTR &&
Expand Down Expand Up @@ -263,7 +263,7 @@ object Zeroconf:

val answers = List(ptr)
val additionals = List(srv, txt) ++ as
val header = DnsHeader(
val header = DnsHeader(
id = 0,
`type` = DnsType.Response,
opCode = DnsOpCode.StandardQuery,
Expand All @@ -278,7 +278,7 @@ object Zeroconf:
end serviceResponse

val servers = for
itf <- interface.map(Stream.emit).getOrElse(networkInterfaces())
itf <- interface.map(Stream.emit).getOrElse(networkInterfaces())
addresses <- Stream.eval {
if instance.addresses.nonEmpty then Sync[F].pure(instance.addresses) // TODO filter if non reachable on itf ?
else Sync[F].delay(itf.inetAddresses().filter(_.isSiteLocalAddress()).toScala(List))
Expand Down
Loading