Skip to content

Commit

Permalink
Upgrade to scalafmt-core 3.0.2 (#1822)
Browse files Browse the repository at this point in the history
* Update scalafmt-core to 3.0.2

* Reformat with scalafmt 3.0.2

* Reformat

* Upgrade setup-scala to 11

Co-authored-by: Scala Steward <[email protected]>
  • Loading branch information
xerial and scala-steward authored Sep 5, 2021
1 parent bbca62f commit 18bd9c5
Show file tree
Hide file tree
Showing 132 changed files with 1,192 additions and 1,347 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: olafurpg/setup-scala@v10
- uses: olafurpg/setup-scala@v11
with:
java-version: [email protected]
- name: Scala 2.13 test with coverage report
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/package-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: olafurpg/setup-scala@v10
- uses: olafurpg/setup-scala@v11
with:
java-version: [email protected]
- name: Packaging test
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fetch-depth: 10000
# Fetch all tags so that sbt-dynver can find the previous release version
- run: git fetch --tags -f
- uses: olafurpg/setup-scala@v10
- uses: olafurpg/setup-scala@v11
with:
java-version: [email protected]
- name: Setup GPG
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
# Fetch all tags so that sbt-dynver can find the previous release version
- run: git fetch --tags -f
# Install OpenJDK 11
- uses: olafurpg/setup-scala@v10
- uses: olafurpg/setup-scala@v11
with:
java-version: [email protected]
- name: Setup GPG
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sbt-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
# Fetch all tags so that sbt-dynver can find the previous release version
- run: git fetch --tags -f
working-directory: ./airframe
- uses: olafurpg/setup-scala@v10
- uses: olafurpg/setup-scala@v11
with:
java-version: [email protected]
- name: Get Airframe version
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
fetch-depth: 10000
# Fetch all tags so that sbt-dynver can find the previous release version
- run: git fetch --tags
- uses: olafurpg/setup-scala@v10
- uses: olafurpg/setup-scala@v11
with:
java-version: [email protected]
- name: Publish snapshots
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: olafurpg/setup-scala@v10
- uses: olafurpg/setup-scala@v11
with:
java-version: [email protected]
- name: Scala 2.12 test
Expand All @@ -40,7 +40,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: olafurpg/setup-scala@v10
- uses: olafurpg/setup-scala@v11
with:
java-version: [email protected]
- name: Scala 2.13 test
Expand All @@ -50,7 +50,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: olafurpg/setup-scala@v10
- uses: olafurpg/setup-scala@v11
with:
java-version: [email protected]
- name: Scala 2.13 + JDK16 test
Expand All @@ -60,7 +60,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: olafurpg/setup-scala@v10
- uses: olafurpg/setup-scala@v11
with:
java-version: [email protected]
- name: Scala 3.x test
Expand All @@ -71,7 +71,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: olafurpg/setup-scala@v10
- uses: olafurpg/setup-scala@v11
with:
java-version: [email protected]
- uses: actions/setup-node@v2
Expand All @@ -86,7 +86,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: olafurpg/setup-scala@v10
- uses: olafurpg/setup-scala@v11
with:
java-version: [email protected]
- uses: actions/setup-node@v2
Expand Down
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = 2.7.5
version = 3.0.2
maxColumn = 120
style = defaultWithAlign
optIn.breaksInsideChains = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ package wvlet.airframe.canvas
import java.nio.ByteBuffer

/**
* Canvas implementation with Unsafe memory access.
* This provides native C-code level access performance.
* Canvas implementation with Unsafe memory access. This provides native C-code level access performance.
*/
final class UnsafeCanvas(
// Base object for resolving the relative address of the raw byte array.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ object DataType {
}

/**
* Union type represents a type whose data can be one of the specified types.
* The members of a union type need to be record types.
* Union type represents a type whose data can be one of the specified types. The members of a union type need to be
* record types.
* @param types
*/
case class UNION(types: Seq[RecordType]) extends StructuredType {
Expand Down Expand Up @@ -94,7 +94,8 @@ object DataType {
@transient private lazy val columnIdx: Map[String, Int] = column.map(_.name).zipWithIndex.toMap[String, Int]

/**
* @param index 0-origin index
* @param index
* 0-origin index
* @return
*/
def columnType(index: Int): Column = column(index)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ trait MessageCodec[A] extends LogSupport {
def pack(v: A): MsgPack = toMsgPack(v)

/**
* Converting the input MessagePack into an object. If the conversion fails,
* throw an IllegalArgumentException
* Converting the input MessagePack into an object. If the conversion fails, throw an IllegalArgumentException
*/
def unpack(msgpack: MsgPack): A = {
val unpacker = am.MessagePack.newUnpacker(msgpack)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ package wvlet.airframe.codec
import wvlet.airframe.codec.DataType._

/**
* MessageContext is used for passing the parsing configuration and
* the last value read by codec.
* MessageContext is used for passing the parsing configuration and the last value read by codec.
*
* For efficiency, it holds several primitive type values as
* local variables to avoid the boxing overhead.
* For efficiency, it holds several primitive type values as local variables to avoid the boxing overhead.
*/
case class MessageContext(
// For now, we have no specific configuration to add
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ trait PackAsMapSupport[A] { self: MessageCodec[A] =>

/**
* A generic codec for parameter lists:
* - array form: [v1, v2, ...]
* - map form: {k1:v1, k2:v2, ..}
* - array form: [v1, v2, ...]
* - map form: {k1:v1, k2:v2, ..}
*
* @param name
* @param params
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -910,12 +910,11 @@ object PrimitiveCodec {
}

/**
* Codec for Any values. This only supports very basic types to enable
* packing/unpacking collections like Seq[Any], Map[Any, Any] at ease.
* Codec for Any values. This only supports very basic types to enable packing/unpacking collections like Seq[Any],
* Map[Any, Any] at ease.
*
* Another option to implement AnyCodec is packing pairs of (type, value), but
* we will not take this approach as this will require many bytes to fully encode
* type names.
* Another option to implement AnyCodec is packing pairs of (type, value), but we will not take this approach as this
* will require many bytes to fully encode type names.
*/
object AnyCodec extends MessageCodec[Any] {
override def pack(p: Packer, v: Any): Unit = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ import wvlet.airframe.msgpack.spi.{Packer, Unpacker}
import wvlet.airframe.surface.{Surface, Union}

/**
* Codec for union classes (e.g., A or B)
* This codec is necessary for defining OpenAPI's model classes
* Codec for union classes (e.g., A or B) This codec is necessary for defining OpenAPI's model classes
*/
case class UnionCodec(codecs: Seq[MessageCodec[_]]) extends MessageCodec[Union] {
override def pack(p: Packer, v: Union): Unit = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ case class Config private[config] (env: ConfigEnv, holder: Map[Surface, ConfigHo
import wvlet.airframe.surface.reflect._

/**
* Create a map representation of this config for display purpose.
* Parameters with @secret annotation will be hidden.
* Create a map representation of this config for display purpose. Parameters with @secret annotation will be hidden.
*/
def toPrintableMap: Map[String, Any] = {
def traverse(s: Surface, v: Any, secret: Option[wvlet.airframe.surface.secret]): Any = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ import scala.sys.process.Process
/**
* OS type resolver
*
* @author leo
* @author
* leo
*/
object OS {
def isWindows: Boolean = getType == OSType.Windows
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,14 @@ object Parallel extends LogSupport {
/**
* Process all elements of the source by the given function then wait for the completion.
*
* @param source Source collection
* @param parallelism Parallelism, the default value is a number of available processors
* @param f Function which processes each element of the source collection
* @return Collection of the results
* @param source
* Source collection
* @param parallelism
* Parallelism, the default value is a number of available processors
* @param f
* Function which processes each element of the source collection
* @return
* Collection of the results
*/
def run[T, R: ClassTag](source: Seq[T], parallelism: Int = Runtime.getRuntime.availableProcessors())(
f: T => R
Expand Down Expand Up @@ -115,13 +119,17 @@ object Parallel extends LogSupport {
}

/**
* Process all elements of the source by the given function then don't wait completion.
* The result is an iterator which is likely a stream which elements are pushed continuously.
* Process all elements of the source by the given function then don't wait completion. The result is an iterator
* which is likely a stream which elements are pushed continuously.
*
* @param source the source iterator
* @param parallelism Parallelism, the default value is a number of available processors
* @param f Function which processes each element of the source collection
* @return Iterator of the results
* @param source
* the source iterator
* @param parallelism
* Parallelism, the default value is a number of available processors
* @param f
* Function which processes each element of the source collection
* @return
* Iterator of the results
*/
def iterate[T, R](
source: Iterator[T],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ object Shell extends LogSupport {
/**
* Kill the process tree rooted from pid
* @param pid
* @return exit code
* @return
* exit code
*/
def killTree(pid: Int, signal: String = "TERM"): Int = {
// stop the parent process first to keep it from forking another child process
Expand Down Expand Up @@ -103,8 +104,7 @@ object Shell extends LogSupport {
}

/**
* launch a command in the remote host. The target host needs to be accessed
* via ssh command without password.
* launch a command in the remote host. The target host needs to be accessed via ssh command without password.
* @param host
* @param cmdLine
*/
Expand All @@ -115,7 +115,8 @@ object Shell extends LogSupport {
/**
* Return the process ID of the current JVM.
*
* @return process id or -1 when process ID is not found.
* @return
* process id or -1 when process ID is not found.
*/
def getProcessIDOfCurrentJVM: Int = {
val r = ManagementFactory.getRuntimeMXBean
Expand All @@ -127,7 +128,8 @@ object Shell extends LogSupport {
/**
* Returns process id
* @param p
* @return process id or -1 if pid cannot be detected
* @return
* process id or -1 if pid cannot be detected
*/
def getProcessID(p: java.lang.Process): Option[Int] = {
Try(p.pid().toInt).toOption.orElse {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ import wvlet.airspec.AirSpec
//--------------------------------------

/**
* @author leo
* @author
* leo
*/
class ShellTest extends AirSpec {

Expand Down
Loading

0 comments on commit 18bd9c5

Please sign in to comment.