Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
xuwei-k committed Jun 20, 2020
1 parent e44ca7f commit 8cb3126
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ continuationIndent.defnSite = 2
docstrings = JavaDoc
includeCurlyBraceInSelectChains = false
optIn.breakChainOnFirstMethodDot = false
version = "2.5.3"
version = "2.6.1"
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ private[optparse_applicative] trait Builder {
def noArgError[A](e: ParseError): Mod[OptionFields, A] =
Mod.field(_.copy(noArgError = e))

/** Specify a metavariable for the argument.
/**
* Specify a metavariable for the argument.
*
* Metavariables have no effect on the parser, and only serve to specify the symbolic name for
* an argument to be displayed in the help text.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import optparse_applicative.types.OptProperties
import scalaz.Monoid
import scalaz.syntax.semigroup._

/** An option modifier.
/**
* An option modifier.
*/
case class Mod[F[_], A](f: F[A] => F[A], prop: DefaultProp[A], g: OptProperties => OptProperties) {
def <>(that: Mod[F, A]): Mod[F, A] =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ private[optparse_applicative] trait Common {
} yield k(x)
}

/** The default value of a Parser. This function returns an error if any of the options don't have a default value
/**
* The default value of a Parser. This function returns an error if any of the options don't have a default value
*/
def evalParser[A](p: Parser[A]): Option[A] =
p match {
Expand All @@ -126,7 +127,8 @@ private[optparse_applicative] trait Common {
case BindP(p, k) => evalParser(p) >>= k.andThen(evalParser[A])
}

/** Map a polymorphic function over all the options of a parser, and collect the results in a list.
/**
* Map a polymorphic function over all the options of a parser, and collect the results in a list.
*/
def mapParser[A, B](f: OptHelpInfo => (Opt ~> Const[B, *]), p: Parser[A]): List[B] = {
def flatten[AA](t: OptTree[AA]): List[AA] =
Expand All @@ -138,7 +140,8 @@ private[optparse_applicative] trait Common {
flatten(treeMapParser(f, p))
}

/** Like mapParser, but collect the results in a tree structure.
/**
* Like mapParser, but collect the results in a tree structure.
*/
def treeMapParser[A, B](g: OptHelpInfo => (Opt ~> Const[B, *]), p: Parser[A]): OptTree[B] = {
def hasDefault[AA](p: Parser[AA]): Boolean =
Expand Down Expand Up @@ -251,7 +254,8 @@ private[optparse_applicative] trait Common {
p1 orElse p2
}

/** Apply a Parser to a command line, and return a result and leftover arguments.
/**
* Apply a Parser to a command line, and return a result and leftover arguments.
* This function returns an error if any parsing error occurs, or if any options are missing and don't have a default value.
*/
def runParser[F[_], A](policy: ArgPolicy, p: Parser[A], args: Args)(implicit F: MonadP[F]): F[(Args, A)] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ import optparse_applicative.helpdoc.Chunk
import scalaz.Functor
import scalaz.syntax.functor._

/** A single option of a parser.
/**
* A single option of a parser.
*/
final case class Opt[A](main: OptReader[A], props: OptProperties)

/** Specification for an individual parser option.
/**
* Specification for an individual parser option.
*/
final case class OptProperties(
visibility: OptVisibility,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import optparse_applicative.helpdoc.Chunk

import scalaz.Functor

/** A full description for a runnable Parser for a program.
/**
* A full description for a runnable Parser for a program.
*
* @param parser the option parser for the program
* @param fullDesc whether the help text should contain full documentation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ package optparse_applicative.types
import scalaz.{-\/, \/, Kleisli, MonadPlus, Plus, ReaderT}
import scalaz.syntax.either._

/** A newtype over the Either monad used by option readers.
/**
* A newtype over the Either monad used by option readers.
*/
final case class ReadM[A](run: ReaderT[String, \/[ParseError, *], A])

Expand Down
3 changes: 2 additions & 1 deletion example/src/main/scala/example/ValidationExample.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import optparse_applicative._
import scalaz.{Applicative, Failure, Success, Validation, ValidationNel}
import scalaz.syntax.apply._

/** Demonstrates combining option parsing (which fails fast when it encounters errors)
/**
* Demonstrates combining option parsing (which fails fast when it encounters errors)
* with error-accumulating validation (using scalaz.Validation).
*/
object ValidationExample {
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.0.0")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.1.0")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.3.9")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.1")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.2")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.3")
addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.13")
addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.4.1")

0 comments on commit 8cb3126

Please sign in to comment.