-
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.
add Scalafix rule to add cats-tagless instances for use with asyncMapK
running the Scalafix rule after generating Finagle code with Scrooge will result in implicit instances being added to the companion objects of the generated Finagle service traits.
- Loading branch information
Showing
20 changed files
with
4,768 additions
and
4 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
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,33 @@ | ||
# 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.