-
Notifications
You must be signed in to change notification settings - Fork 185
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
Update metaconfig-docs to 0.10.0 #1530
Update metaconfig-docs to 0.10.0 #1530
Conversation
As suspected we need to add pprint dependency 🤔 We could also use metaconfig version for the rules in the scalafix config. |
Follow #1522
👍 will amend this
what do you mean? |
3a89fb5
to
055d1d6
Compare
TPrint.make[PathMatcher](_ => "<glob>") | ||
implicit val confPrint: TPrint[Conf] = | ||
TPrint.make[Conf](implicit cfg => TPrint.implicitly[ScalafixConfig].render) | ||
implicit val absolutePathPrint: _root_.pprint.TPrint[AbsolutePath] = |
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 updated the code to compile, but I believe (no tests seem to prevent regressions of 7811980) that all these pprint.TPrint
instances are now effectively useless since they are no longer picked up.
Since scala 2.11 does build against an old metaconfig where pprint is not shaded, I am still wondering what's best:
- start consider dropping scala 2.11 support (mostly useful for Make ExplicitResultTypes work with more Scala versions #998)
- drop these instances (the real impact on the output should be assessed)
- freeze a scala-2.11 version of the implicits in
Args.scala
(https://github.com/tpolecat/doobie/blob/5d0957d95ec64597452c9476a4586dc90f19c437/build.sbt#L231-L237 or symlinks for the rest?)
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 updated the code to compile, but I believe (no tests seem to prevent regressions of 7811980) that all these
pprint.TPrint
instances are now effectively useless since they are no longer picked up.
Confirmed
--- <unnamed>
+++ <unnamed>
@@ -1,20 +1,20 @@
$ sbt "cli/runMain scalafix.cli.Cli --help"
...
[info] running (fork) scalafix.cli.Cli --help
-[info] Scalafix 0.9.34+19-147646c0-SNAPSHOT
+[info] Scalafix 0.9.34+10-055d1d6b-SNAPSHOT
[info] Usage: scalafix [options] [<path> ...]
[info] Scalafix is a refactoring and linting tool. Scalafix supports both syntactic and
[info] semantic linter and rewrite rules. Syntactic rules can run on source code
[info] without compilation. Semantic rules can run on source code that has been
[info] compiled with the SemanticDB compiler plugin.
[info] Common options:
-[info] --rules | -r [String ...] (default: [])
+[info] --rules | -r List[String] (default: [])
[info] Scalafix rules to run, for example ExplicitResultTypes. The syntax for rules is
[info] documented in
[info] https://scalacenter.github.io/scalafix/docs/users/configuration#rules
-[info] --files | -f [<path> ...] (default: [])
+[info] --files | -f List[AbsolutePath] (default: [])
[info] Files or directories (recursively visited) to fix.
-[info] --config <path> (default: null)
+[info] --config Option[AbsolutePath] (default: null)
[info] File path to a .scalafix.conf configuration file. Defaults to .scalafix.conf in
[info] the current working directory, if any.
[info] --check
@@ -25,7 +25,7 @@
[info] --diff
[info] If set, only apply scalafix to added and edited files in git diff against the
[info] master branch.
-[info] --diff-base String (default: null)
+[info] --diff-base Option[String] (default: null)
[info] If set, only apply scalafix to added and edited files in git diff against a
[info] provided branch, commit or tag.
[info] --syntactic
@@ -46,20 +46,20 @@
[info] files that should be fixed must be compiled with semanticdb-scalac.
[info] Dependencies are required by rules like ExplicitResultTypes, but the
[info] dependencies do not need to be compiled with semanticdb-scalac.
-[info] --sourceroot <path> (default: null)
+[info] --sourceroot Option[AbsolutePath] (default: null)
[info] Absolute path passed to semanticdb with -P:semanticdb:sourceroot:<path>.
[info] Relative filenames persisted in the Semantic DB are absolutized by the
[info] sourceroot. Defaults to current working directory if not provided.
-[info] --semanticdb-targetroots [<path> ...] (default: [])
+[info] --semanticdb-targetroots List[AbsolutePath] (default: [])
[info] Absolute paths passed to semanticdb with -P:semanticdb:targetroot:<path>. Used
[info] to locate semanticdb files. By default, Scalafix will try to locate
[info] semanticdb files in the classpath
[info] --auto-classpath
[info] If set, automatically infer the --classpath flag by scanning for directories
[info] with META-INF/semanticdb
-[info] --auto-classpath-roots [<path> ...] (default: [])
+[info] --auto-classpath-roots List[AbsolutePath] (default: [])
[info] Additional directories to scan for --auto-classpath
-[info] --scalac-options [String ...] (default: [])
+[info] --scalac-options List[String] (default: [])
[info] The scala compiler options used to compile this --classpath, for example
[info] -Ywarn-unused-import
[info] --scala-version ScalaVersion (default: "2.13.8")
@@ -82,7 +82,7 @@
[info] autoload -U _scalafix
[info] ```
[info] Less common options:
-[info] --exclude [<glob> ...] (default: [])
+[info] --exclude List[PathMatcher] (default: [])
[info] Unix-style glob for files to exclude from fixing. The glob syntax is defined by
[info] `nio.FileSystem.getPathMatcher`.
[info] --tool-classpath URLClassLoader (default: "<classloader>")
@@ -94,15 +94,15 @@
[info] If set, throw exception in the end instead of System.exit
[info] --no-stale-semanticdb
[info] Don't error on stale semanticdb files.
-[info] --settings ScalafixConfig (default: {})
+[info] --settings Conf (default: {})
[info] Custom settings to override .scalafix.conf
-[info] --out-from String (default: null)
+[info] --out-from Option[String] (default: null)
[info] Write fixed output to custom location instead of in-place. Regex is passed as
[info] first argument to file.replaceAll(--out-from, --out-to), requires --out-to.
-[info] --out-to String (default: null)
+[info] --out-to Option[String] (default: null)
[info] Companion of --out-from, string that is passed as second argument to
[info] fileToFix.replaceAll(--out-from, --out-to)
[info] --auto-suppress-linter-errors
[info] Insert /* scalafix:ok */ suppressions instead of reporting linter errors.
-[info] --cwd <path> (default: "/Users/anabrice/Projects/git/scalafix/scalafix-cli")
+[info] --cwd AbsolutePath (default: "/Users/anabrice/Projects/git/scalafix/scalafix-cli")
[info] The current working directory
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 went for option (3)
055d1d6
to
ffcd8b9
Compare
😭 I got back to this (yet unreleased) PR today while trying out rules built with a scalafix-core SNAPSHOT with a stable scalafix-core (something not tested in CI)
It's a compatibility issue similar to what's discussed in #1556 (comment), except that it's with metaconfig rather than scalameta and results in an exception rather than false negative matches
|
Since we have a breaking change upstream, I am ready to accept that rules built against latest versions of scalafix-core needs a recent scalafix client, but we need a more explicit message/error. Ideally this message should be injected at compile time since we don't have control over existing clients.
Maybe for a while scalafix-core could bring something evicting metaconfig-pprint at build time (via a |
#1562 adds an actionable message |
Updates com.geirsson:metaconfig-docs from 0.9.15 to 0.10.0.
GitHub Release Notes - Version Diff
I'll automatically update this PR to resolve conflicts as long as you don't change it yourself.
If you'd like to skip this version, you can just close this PR. If you have any feedback, just mention me in the comments below.
Configure Scala Steward for your repository with a
.scala-steward.conf
file.Have a fantastic day writing Scala!
Files still referring to the old version number
The following files still refer to the old version number (0.9.15).
You might want to review and update them manually.
Ignore future updates
Add this to your
.scala-steward.conf
file to ignore future updates of this dependency:labels: library-update, early-semver-major, semver-spec-minor, old-version-remains, commit-count:1