-
Notifications
You must be signed in to change notification settings - Fork 502
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
Run Scalafix build migrations using sbt #3133
base: main
Are you sure you want to change the base?
Run Scalafix build migrations using sbt #3133
Conversation
@fthomas is it possible to dry run Scala Steward (i.e. not open any PRs)? I'd like to test this out but I don't really want to open PRs against other folks' projects. |
This comment was marked as outdated.
This comment was marked as outdated.
What I also use sometimes for testing is a test repo (like https://github.com/scala-steward-org/test-repo-2) with multiple branches. If Scala Steward creates a PR for a specific branch and I want to test my changes again, I just push another branch (without Scala Steward's change) to the repo and point Scala Steward to that new branch. |
OK, I've tested this now on a few projects with some mixed results:
|
I have done some work on this in sbt-tpolecat now and will send a PR to update the migration SHA in scala-steward
I have asked the Scalafix experts in the Scalameta Discord about this 🤞 that they have some idea how to fix it |
OK, so the word is that That means we need to continue running syntactic migrations on |
:-(
You mean via the |
I think it would just have not run the migration, avoiding the errors due to missing semanticdb |
b5f2cae
to
be3c89a
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #3133 +/- ##
==========================================
+ Coverage 91.04% 91.08% +0.04%
==========================================
Files 162 162
Lines 3406 3423 +17
Branches 315 312 -3
==========================================
+ Hits 3101 3118 +17
Misses 305 305
☔ View full report in Codecov by Sentry. |
|
||
[*.{scala,sbt}] | ||
indent_size = 2 | ||
indent_style = space |
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 added this because it drives me mad when VS Code uses 4 space indent by default and this configures all editors that understand it 😛
Stream.eval(F.delay(dir.walk(maxDepth))).flatMap(Stream.fromBlockingIterator(_, 1)), | ||
Stream.empty.covary[F] | ||
) | ||
) |
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.
It seems that Files.walk
throws an exception if the directory does not exist rather than simply returning an empty iterator
Tries to fix an issue encountered in #3126 whereby Scalafix build migrations failed because they require SemanticDB to be enabled.
This PR changes the
SbtAlg
to make use of sbt to run Scalafix migrations.It does this by writing the required sbt configuration files recursively up to the deepest meta-build found in the project before running the scalafix command in each meta-build, similar to
getDependencies
.The Scalafix CLI is still used to run syntactic migrations, because sbt-scalafix cannot run migrations on
*.sbt
files.Thanks to my employer @opencastsoftware for sponsoring this work.