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.0.0 #254

Merged
merged 2 commits into from
Aug 20, 2021
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: 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.0"

style = default

Expand Down
4 changes: 2 additions & 2 deletions bench/src/main/scala/cats/parse/bench/parboiled2.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import scala.annotation.switch
import org.parboiled2._
import org.typelevel.jawn.ast._

/** This is a feature-complete JSON parser implementation that almost directly
* models the JSON grammar presented at http://www.json.org as a parboiled2 PEG parser.
/** This is a feature-complete JSON parser implementation that almost directly models the JSON
* grammar presented at http://www.json.org as a parboiled2 PEG parser.
*/
class JsonParser(val input: ParserInput) extends Parser with StringBuilding {
import CharPredicate.{Digit, Digit19, HexDigit}
Expand Down
5 changes: 2 additions & 3 deletions bench/src/main/scala/cats/parse/bench/self.scala
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ object Json {
private[this] val whitespace: P[Unit] = P.charIn(" \t\r\n").void
private[this] val whitespaces0: P0[Unit] = whitespace.rep0.void

/** This doesn't have to be super fast (but is fairly fast) since we use it in places
* where speed won't matter: feeding it into a program that will convert it to bosatsu
* structured data
/** This doesn't have to be super fast (but is fairly fast) since we use it in places where speed
* won't matter: feeding it into a program that will convert it to bosatsu structured data
*/
val parser: P[JValue] = P.recursive[JValue] { recurse =>
val pnull = P.string("null").as(JNull)
Expand Down
13 changes: 5 additions & 8 deletions core/shared/src/main/scala/cats/parse/Accumulator.scala
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,14 @@ object Appender {
}
}

/** Creates an appender given the first item to be added
* This is used to build the result in Parser.repAs
/** Creates an appender given the first item to be added This is used to build the result in
* Parser.repAs
*/
trait Accumulator[-A, +B] {
def newAppender(first: A): Appender[A, B]
}

/** Creates an appender
* This is used to build the result in Parser.repAs0
/** Creates an appender This is used to build the result in Parser.repAs0
*/
trait Accumulator0[-A, +B] extends Accumulator[A, B] {
def newAppender(): Appender[A, B]
Expand Down Expand Up @@ -124,10 +123,8 @@ object Accumulator0 {
def newAppender() = Appender.fromBuilder(Vector.newBuilder[A])
}

/** An accumulator that does nothing and returns Unit
* Note, this should not generally be used with repAs0
* because internal allocations still happen. Instead
* use .rep0.void
/** An accumulator that does nothing and returns Unit Note, this should not generally be used with
* repAs0 because internal allocations still happen. Instead use .rep0.void
*/
val unitAccumulator0: Accumulator0[Any, Unit] =
new Accumulator0[Any, Unit] {
Expand Down
7 changes: 3 additions & 4 deletions core/shared/src/main/scala/cats/parse/LocationMap.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ package cats.parse

import java.util.Arrays

/** This is a class to convert linear offset in
* a string into lines, or the column and line numbers.
/** This is a class to convert linear offset in a string into lines, or the column and line numbers.
*
* This is useful for display to humans who in text
* editors think in terms of line and column numbers
* This is useful for display to humans who in text editors think in terms of line and column
* numbers
*/
class LocationMap(val input: String) {
private[this] val lines: Array[String] =
Expand Down
7 changes: 3 additions & 4 deletions core/shared/src/main/scala/cats/parse/Numbers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ object Numbers {
val nonZeroDigit: Parser[Char] =
Parser.charIn('1' to '9')

/** A String of either 1 '0' or
* 1 non-zero digit followed by zero or more digits
/** A String of either 1 '0' or 1 non-zero digit followed by zero or more digits
*/
val nonNegativeIntString: Parser[String] =
(nonZeroDigit ~ digits0).void
Expand All @@ -59,8 +58,8 @@ object Numbers {
val bigInt: Parser[BigInt] =
signedIntString.map(BigInt(_))

/** A string matching the json specification for numbers.
* from: https://tools.ietf.org/html/rfc4627
/** A string matching the json specification for numbers. from:
* https://tools.ietf.org/html/rfc4627
*/
val jsonNumber: Parser[String] = {
/*
Expand Down
Loading