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

Add RenameInjectProdAndCoproduct, RenameTupleApplySyntax and RemoveSplit Scalafix rewrites #1813

Merged
merged 6 commits into from
Aug 11, 2017

Conversation

gabro
Copy link
Contributor

@gabro gabro commented Aug 10, 2017

This PR adds these rewrites:

  • RenameInjectProdAndCoproduct
  • RenameTupleApplySyntax
  • RemoveSplit

Two of them are super easy thanks to a feature recently landed in Scalafix (replaceSymbol). For this reason I also upgraded Scalafix to the latest milestone release for 0.5.0.

@gabro gabro changed the title Add RenameInjectProdAndCoproduct Scalafix rewrite Add RenameInjectProdAndCoproduct and RenameTupleApplySyntax Scalafix rewrites Aug 10, 2017
@codecov-io
Copy link

codecov-io commented Aug 10, 2017

Codecov Report

Merging #1813 into master will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1813      +/-   ##
==========================================
+ Coverage   94.88%   94.88%   +<.01%     
==========================================
  Files         241      241              
  Lines        4147     4148       +1     
  Branches       97      103       +6     
==========================================
+ Hits         3935     3936       +1     
  Misses        212      212
Impacted Files Coverage Δ
core/src/main/scala/cats/Show.scala 100% <0%> (ø) ⬆️
core/src/main/scala/cats/data/EitherT.scala 98.27% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3238de6...94a8050. Read the comment docs.

@gabro gabro changed the title Add RenameInjectProdAndCoproduct and RenameTupleApplySyntax Scalafix rewrites Add RenameInjectProdAndCoproduct, RenameTupleApplySyntax and RemoveSplit Scalafix rewrites Aug 10, 2017
Copy link
Collaborator

@peterneyens peterneyens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Just left one comment about the Split syntax. Not sure if want to support that one as well?


import cats.implicits._
import cats.arrow.Split
import cats.syntax.split._
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The split syntax isn't actually used below, and if it was used it, this import would clash with cats.implicits._.

If you want to test the split syntax you would have

import cats.syntax.split._ // afterwards => import cats.syntax.arrow._
import cats.instances.function._

val f = toLong split toDouble

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, good catch, thanks. That's a half-baked attempt that I accidentally left in there.
I just pushed a proper version of that fix.

By the way, it'd be nice if scalafix tests were run by the CI (so that these kind of mistake would be caught). Do you think it's possible to add them to the build?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should add them to the build. We can tackle it in another PR.

@kailuowang kailuowang merged commit 22e7175 into typelevel:master Aug 11, 2017
@kailuowang kailuowang added this to the 1.0.0-RC1 milestone Oct 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants