-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from Dwolla/scalafix
Scalafix rule for adding necessary implicits to generated code
- Loading branch information
Showing
21 changed files
with
4,852 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sbt.version=1.5.3 | ||
sbt.version=1.5.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.20") | ||
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.7") | ||
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.9") | ||
addSbtPlugin("com.eed3si9n" % "sbt-projectmatrix" % "0.8.0") | ||
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.5.1") | ||
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.7.0") | ||
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.31") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Scalafix Notes | ||
|
||
## Scrooge Updates | ||
|
||
Scrooge updates roughly monthly, and occasionally the updates introduce | ||
breaking changes in the generated code. (For example, between the `21.5.0` | ||
and `21.8.0` versions, [a new abstract method was added to the `ValidatingThriftStructCodec3`](https://github.com/twitter/scrooge/commit/fdb8f8f2d9cc30d6ca06b117fe7a82003f330ba8#diff-1fb7ff7b4c7a64ec907dfa620403b5b190f9829f3d5e6e0d57d07685dd53411f) | ||
trait, which implementations generated by the older version will be missing.) | ||
|
||
As a result, the files in `scalafix/input/src/main/scala/example/thrift` and | ||
`scalafix/output/src/main/scala/example/thrift` may need to be regenerated when | ||
the Scrooge version is updated by running the `regenerate-inputs.sh` script with | ||
the new Scrooge version as the first parameter. | ||
|
||
```bash | ||
./regenerate-inputs.sh 21.8.0 | ||
``` | ||
|
||
Then edit `scalafix/output/src/main/scala/example/thrift/SimpleService.scala` and replace the | ||
blank line at the end of the `SimpleService` object with these lines: | ||
|
||
```scala | ||
|
||
implicit def SimpleServiceInReaderT[F[_]]: SimpleService[({type Λ[β0] = _root_.cats.data.ReaderT[F, SimpleService[F], β0]})#Λ] = | ||
_root_.cats.tagless.Derive.readerT[SimpleService, F] | ||
|
||
implicit val SimpleServiceFunctorK: _root_.cats.tagless.FunctorK[SimpleService] = _root_.cats.tagless.Derive.functorK[SimpleService] | ||
``` | ||
|
||
(Newlines and whitespace matter to the tests!) |
Oops, something went wrong.