sbt/project
Ethan Atkins 03cb79bbfc Stop using ---/pair in SbtLauncherPlugin
I'd like to remove '---' and 'pair' in sbt 2 so I'm inlining the logic where
I find it. The '---' method is trivially implemented with a filter on
the sequence of files and filtering the output will not require io,
unlike '---'. For pair, I get confused every time I see it in the code
and it is rarely saving more than a line. While I understand that it may
have been convenient when the code using pair was originally written, I
don't think it is worth the maintenance cost. My specific issue is that
to me pair means tuple2, full stop. The definition of pair is:
def pair[T](mapper: File => Option[T], errorIfNone: Boolean = true): Seq[(File, T)]
First of all, it's not at all obvious when seen inline in the code that
it has the side effect of evaluating PathFinder.get. Moreover, it
doesn't return a general pair, it's a very specific pair with a File in
the first position. I just don't see how using pair improves upon, say:

val func: File => Option[(File, String)] = ???
globs.all.flatMap(func)

or

val func: File => Option[(File, String)] = ???
globs.all.map(f => func(f) match {
  case Some(r) => r
  case None => throw new IllegalStateException("Couldn't evaluate func for $f")
}) // or just define `func = File => (File, String)` and throw on an error
2019-03-22 07:53:41 -07:00
..
ContrabandConfig.scala Adjust to upstream changes 2017-07-16 00:51:49 -04:00
Dependencies.scala Bump io 2019-03-22 07:53:41 -07:00
Docs.scala sbt 1.0.0-RC2 2017-07-20 06:56:37 +01:00
NightlyPlugin.scala Bump up test frameworks used in scripted tests 2018-09-29 23:19:49 -04:00
PublishBinPlugin.scala Update PublishBinPlugin to current sbt 2018-03-06 11:54:13 +00:00
Release.scala Upgrade the build to sbt 1.0.0-M5 2017-05-11 09:44:42 +01:00
SbtLauncherPlugin.scala Stop using ---/pair in SbtLauncherPlugin 2019-03-22 07:53:41 -07:00
Scripted.scala Allow sbt scripted tests to run in parallel 2019-01-31 17:43:14 -08:00
StatusPlugin.scala cleaning up a few compiler warnings 2018-09-17 22:30:14 -04:00
Sxr.scala sbt 1.0.0-RC2 2017-07-20 06:56:37 +01:00
Transform.scala Upgrade the build to sbt 1.0.0-M5 2017-05-11 09:44:42 +01:00
Util.scala -Yrangepos for sbt 2018-10-11 15:44:15 -04:00
build.properties sbt 1.2.8 2019-02-23 04:36:06 -05:00
flamegraph_svg.png document profiling tools 2018-04-04 01:29:56 -04:00
plugins.sbt Bump scala version 2.12.8 2019-01-08 11:11:23 -08:00