-
Notifications
You must be signed in to change notification settings - Fork 186
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
Clean up tests #165
Clean up tests #165
Conversation
Also, it always bugged me that misformatted file errors blocked tests. This change makes it so that scalafmt is only run on a single entry in the build matrix
- scalafix-testkit no longer interfaces with the ScalahostPipeline API. Instead, we use sbt-scalahost to build a mirror and buildinfo to generate the necessary mappings between original and expected code. This results in a cleaner test setup: - no more .source files without syntax highlighting and auto-completion. - less duplication wrapping every unit test in `object a { }` - cleaner compiler errors in input/output projects - easier to use custom classpath for single test suite, just add a new project! - Remove old organize imports. OrganizeImports was implemented before Symbols came and the current implementation is weird adaptation from the old ScalafixMirror that no longer exists. Instead of keeping this cruft, this commit removes the import patches with less ambitious patch implementation that are still somewhat useful.
- Remove more legacy. - Support SKIP and ONLY. - Throw error at end of test suite if some test is marked as ONLY
cc/ @ShaneDelmore scalafix-testkit just got a whole lot simpler, since it no longer uses |
92119f9
to
1142a90
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like looking at pull requests that remove bunches of code! ❤️
implicit class XtensionSeqPatch(patches: Seq[Patch]) { | ||
def asPatch: Patch = Patch.fromSeq(patches) | ||
implicit class XtensionSeqPatch(patches: Iterable[Patch]) { | ||
def asPatch: Patch = Patch.fromIterable(patches) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the motivation behind Iterable
? I wonder what use cases you found for this more general type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iirc, I'm using views on Tokens
to build patches. Views are not Seq[]
@@ -0,0 +1,69 @@ | |||
/* | |||
rewrites = ExplicitReturnTypes | |||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Travis CI kills the jobs. Those tests only run a subset of rewrites anyways. Those tests are incredibly handy for manual testing, less so for automated CI on every PR commit.
Bumps [coursier/cache-action](https://github.com/coursier/cache-action) from v5 to v6. - [Release notes](https://github.com/coursier/cache-action/releases) - [Commits](coursier/cache-action@v5...730a6a4) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
The scalafix repo has accumulated a lot of successful and not-so-successful experiments over the past year. This PR cleans up what I found to be not-so-successful around our testing infrastructure an imports management: