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

Load Scalafix migrations from this repository #1650

Merged
merged 10 commits into from
Oct 10, 2020

Conversation

fthomas
Copy link
Member

@fthomas fthomas commented Oct 9, 2020

This changes MigrationAlg so that it loads always the latest Scalafix
migrations from this repository instead of using the static list of
migrations that is shipped as resource in the JAR.

The following changes with this PR:

  • The --scalafix-migrations option can now be used multiple times to
    load extra migrations not only from one but multiple files.
  • Arguments to the --scalafix-migrations cannot only be local files
    but also remote URLs.
  • Disabling loading the default Scalafix migrations is now done via a
    new --disable-default-scalafix-migrations option instead of using
    disableDefaults in an extra migrations file.
  • Scala Steward now prints how many Scalafix migrations it loaded at
    start-up.

Closes: #1603

This changes `MigrationAlg` so that it loads always the latest Scalafix
migrations from this repository instead of using the static list of
migrations that is shipped as resource in the JAR.

The following changes with this PR:
* The `--scalafix-migrations` option can now be used multiple times to
  load extra migrations not only from one but multiple files.
* Arguments to the `--scalafix-migrations` cannot only be local files
  but also remote URLs.
* Disabling loading the default Scalafix migrations is now done via a
  new `--disable-default-scalafix-migrations` option instead of using
  `disableDefaults` in an extra migrations file.
* Scala Steward now prints how many Scalafix migrations it loaded at
  start-up.

Closes: #1603
@fthomas fthomas added the enhancement New feature or request label Oct 9, 2020
@fthomas fthomas added this to the 0.8.0 milestone Oct 9, 2020
@codecov
Copy link

codecov bot commented Oct 9, 2020

Codecov Report

Merging #1650 into master will decrease coverage by 0.01%.
The diff coverage is 60.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1650      +/-   ##
==========================================
- Coverage   71.69%   71.68%   -0.02%     
==========================================
  Files         113      114       +1     
  Lines        1876     1875       -1     
  Branches       46       57      +11     
==========================================
- Hits         1345     1344       -1     
  Misses        531      531              
Impacted Files Coverage Δ
.../scala/org/scalasteward/core/application/Cli.scala 100.00% <ø> (ø)
...ala/org/scalasteward/core/application/Config.scala 0.00% <0.00%> (ø)
...la/org/scalasteward/core/application/Context.scala 0.00% <0.00%> (ø)
...org/scalasteward/core/application/StewardAlg.scala 0.00% <ø> (ø)
...calasteward/core/scalafix/ScalafixMigrations.scala 100.00% <ø> (ø)
.../main/scala/org/scalasteward/core/io/FileAlg.scala 84.84% <100.00%> (+2.08%) ⬆️
.../org/scalasteward/core/scalafix/MigrationAlg.scala 100.00% <100.00%> (ø)
.../scalasteward/core/scalafix/MigrationsLoader.scala 100.00% <100.00%> (ø)

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 4907a74...fa5ed9a. Read the comment docs.

docs/scalafix-migrations.md Outdated Show resolved Hide resolved
docs/scalafix-migrations.md Outdated Show resolved Hide resolved
docs/scalafix-migrations.md Outdated Show resolved Hide resolved
@fthomas fthomas merged commit f9b4d80 into master Oct 10, 2020
@fthomas fthomas deleted the topic/load-latest-scalafix-migrations branch October 11, 2020 12:21
fthomas added a commit that referenced this pull request Sep 23, 2021
This splits `ArtifactMigrations` into a loader and finder class. The
former loads the latest artifact migrations from this repository instead
of using the static list of migrations that is shipped as resource in
the JAR. That means that all Scala Steward instances use the artifact
migrations from this repository as soon as they are added here.

The following changes with this PR:
* The `--artifact-migrations` option can now be used multiple times to
  load extra migrations not only from one but multiple files.
* Arguments to the `--artifact-migrations` cannot only be local files
  but also remote URLs.
* Scala Steward prints how many artifact migrations it loaded at
  start-up.

The same has been done for Scalafix migrations in #1650.

Closes: #1963
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Load latest list of Scalafix migrations from this repo
2 participants