Skip to content

Commit

Permalink
324 - fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
regis-leray committed Aug 7, 2023
1 parent f461d9a commit 32d3e05
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 30 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ jobs:
strategy:
fail-fast: false
matrix:
java: ['adopt@1.8']
scala: ['2.11.12', '2.12.16', '2.13.8', '3.2.2']
java: ['amazon-corretto@1.17']
scala: ['2.12.16', '2.13.8', '3.2.2']
steps:
- name: Checkout current branch
uses: actions/checkout@v3.5.1
Expand Down
20 changes: 2 additions & 18 deletions project/BuildHelper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@ object BuildHelper {
def stdSettings(prjName: String) =
Seq(
name := s"$prjName",
crossScalaVersions := Seq(Scala211, Scala212, Scala213, Scala3),
crossScalaVersions := Seq(Scala212, Scala213, Scala3),
ThisBuild / scalaVersion := Scala213,
scalacOptions := stdOptions ++ extraOptions(scalaVersion.value),
incOptions ~= (_.withLogRecompileOnMacro(false))
)

final val Scala211 = "2.11.12"
final val Scala212 = "2.12.16"
final val Scala213 = "2.13.8"
final val Scala3: String = "3.2.2"
final val Scala3: String = "3.3.0"

final private val stdOptions = Seq(
"-deprecation",
Expand Down Expand Up @@ -69,21 +68,6 @@ object BuildHelper {
"-Ywarn-nullary-unit",
"-Ywarn-unused-import"
) ++ std2xOptions
case Some((2, 11)) =>
Seq(
"-Ypartial-unification",
"-Yno-adapted-args",
"-Ywarn-inaccessible",
"-Ywarn-infer-any",
"-Ywarn-nullary-override",
"-Ywarn-nullary-unit",
"-Xexperimental",
"-Ywarn-unused-import",
"-Xfuture",
"-Xsource:2.13",
"-Xmax-classfile-name",
"242"
) ++ std2xOptions
case _ => Seq.empty
}
}
11 changes: 5 additions & 6 deletions zio-ftp/src/main/scala/zio/ftp/FtpSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,14 @@ object KeyFileSftpIdentity {
KeyFileSftpIdentity(privateKey, None)
}


sealed abstract class ProtectionLevel(val s: String)
object ProtectionLevel{
final case object Clear extends ProtectionLevel("C")
final case object Private extends ProtectionLevel("P")

object ProtectionLevel {
case object Clear extends ProtectionLevel("C")
case object Private extends ProtectionLevel("P")
}

/**
*
* @param isImplicit // security mode (Implicit/Explicit)
* @param pbzs // Protection Buffer SiZe default value 0
* @param prot // data channel PROTection level default value C
Expand All @@ -142,7 +141,7 @@ object ProtectionLevel{
*/
final case class SslParams(isImplicit: Boolean, pbzs: Long, prot: ProtectionLevel)

object SslParams{
object SslParams {
val default: SslParams = SslParams(false, 0L, ProtectionLevel.Clear)
}

Expand Down
6 changes: 3 additions & 3 deletions zio-ftp/src/main/scala/zio/ftp/UnsecureFtp.scala
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ object UnsecureFtp {
def connect(settings: UnsecureFtpSettings): ZIO[Scope, ConnectionError, FtpAccessors[Client]] =
acquireRelease(
attemptBlockingIO {
val ftpClient = settings.sslParams.fold(new JFTPClient()){ ssl =>
val ftpClient = settings.sslParams.fold(new JFTPClient()) { ssl =>
val c = new JFTPSClient(ssl.isImplicit)
c.execPBSZ(ssl.pbzs)
c.execPROT(ssl.prot.s)
//c.execPBSZ(ssl.pbzs)
//c.execPROT(ssl.prot.s)
c
}

Expand Down
2 changes: 1 addition & 1 deletion zio-ftp/src/test/scala/zio/ftp/SecureFtpSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ object SecureFtpSpec extends ZIOSpecDefault {
val settings = SecureFtpSettings("127.0.0.1", port = 2222, FtpCredentials("foo", "foo"))

val home = Paths.get("ftp-home/sftp/home/foo")

override def spec: Spec[TestEnvironment & Scope, Any] =
suite("SecureFtpSpec")(
test("invalid credentials")(
Expand Down

0 comments on commit 32d3e05

Please sign in to comment.