-
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
Support Scalafix migrations that target build files #2308
Merged
Merged
Conversation
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
Codecov Report
@@ Coverage Diff @@
## master #2308 +/- ##
==========================================
+ Coverage 78.45% 79.67% +1.21%
==========================================
Files 136 137 +1
Lines 2349 2386 +37
Branches 58 59 +1
==========================================
+ Hits 1843 1901 +58
+ Misses 506 485 -21
Continue to review full report at Codecov.
|
... because files a build migration targets are build tool specific.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What has been done in this PR?
This PR extends the Scalafix support to run migrations with the Scalafix CLI in addition to sbt-scalafix. Migrations that are executed with the CLI target
*.sbt
andproject/*.scala
files in the build root directories. So thesebuild
migrations can change build files while regularsources
migrations can change source files.How?
To distinguish between
sources
andbuild
migrations a new optionaltarget
field is added toScalafixMigration
. The default value issources
if this field is not specified. Scala Steward differentiate these two targets inSbtAlg
and either calls the proper sbt command or thescalafix
CLI. A newScalafixCli
class is added that takes care of running migrations with the CLI.Want to see it in action?
This PR also adds @eed3si9n's
Sbt0_13BuildSyntax
for unified slash syntax to our list of Scalafix migrations:scala-steward/modules/core/src/main/resources/scalafix-migrations.conf
Lines 92 to 100 in 2018290
which is used when sbt is bumped over 1.5.0. An example PR where the above migration was used and contains changes to
build.sbt
from Scalafix is:The above PR also demonstrate another new feature:
Co-authored-by:
attribution of the Scalafix rule authors (#1914). @eed3si9n I added your name to theauthors
field above to test that feature but I'll only keep your name there if you're fine with this attribution in all future PRs where Scala Steward executes theSbt0_13BuildSyntax
rule.Other notable changes