Skip to content

add scalafmt #578

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

Closed
wants to merge 13 commits into from
Closed

add scalafmt #578

wants to merge 13 commits into from

Conversation

SethTisue
Copy link
Member

No description provided.

@SethTisue SethTisue changed the base branch from 2.11.x to 2.12.x July 25, 2017 00:38
@SethTisue
Copy link
Member Author

this can be rebased once #535 is merged

@SethTisue
Copy link
Member Author

hey @olafurpg I'm getting this:

[scalafmt] [error] /Users/tisue/community-builds.212/target-0.9.7/project-builds/scalafmt-864ced34186e7d2b7c9bcdc3078e074d7e1e8f1e/core/src/main/scala/org/scalafmt/Error.scala:1: both org.scalamacros.paradise.typechecker.AnalyzerPlugins$MacroPlugin$@492d8c60 and org.scalameta.paradise.typechecker.AnalyzerPlugins$MacroPlugin$@53093c67 want to enter a symbol for this tree
[scalafmt] [error] package org.scalafmt
[scalafmt] [error]             ^
[scalafmt] scala.reflect.internal.Types$TypeError: both org.scalamacros.paradise.typechecker.AnalyzerPlugins$MacroPlugin$@492d8c60 and org.scalameta.paradise.typechecker.AnalyzerPlugins$MacroPlugin$@53093c67 want to enter a symbol for this tree

looks like somehow org.scalamacros#paradise and org.scalameta#paradise are both getting pulled in

@SethTisue SethTisue self-assigned this Jul 25, 2017
@SethTisue SethTisue mentioned this pull request Jul 25, 2017
@SethTisue
Copy link
Member Author

@olafurpg I do recall that you were previously skeptical about having scalafix in the community build (#499 (comment)), probably those same concerns about evolution and fragility apply here too

@SethTisue
Copy link
Member Author

[scalafmt] The following subprojects will be built in project scalafmt: utils, testUtils, core, cli, readme, benchmarks, scalafmtSbt, root
...
[info] Project scalafmt
[info]   depends on: acyclic, fastparse, kind-projector, macro-compat, macro-paradise, meta-paradise, metaconfig, pcplod, scala, scala-js, scala-parser-combinators, scalacheck, scalameta, scalapb, scalapb-lenses, scalariform, scalatags, scalatest, scalatex, scalaz, scopt, shapeless, sourcecode, specs2, utest

I tried building only core, but that didn't make the error go away

@SethTisue
Copy link
Member Author

arggghhh, I think I used olafurpg/scalafmt when I should have used scalameta/scalafmt. let me fix that and see whether that helps...

@SethTisue
Copy link
Member Author

SethTisue commented Jul 25, 2017

sigh, now I get [scalafmt] [error] **** Missing dependency: the library com.geirsson#metaconfig-typesafe-config is not provided (in space "default") by any project in this configuration file.

but then if I try add to add metaconfig-typesafe-config to the metaconfig entry, I get

[metaconfig] [error] /Users/tisue/community-builds.212/target-0.9.7/project-builds/metaconfig-8e797a3467b5923cfd14ceefd02aa3f26e32123d/metaconfig-typesafe-config/src/main/scala/metaconfig/typesafeconfig/package.scala:11: value toFile is not a member of scala.meta.io.AbsolutePath
[metaconfig] [error]  Note: implicit value typesafeConfigMetaconfigParser is not applicable here because it comes after the application point and it lacks an explicit result type
[metaconfig] [error] /Users/tisue/community-builds.212/target-0.9.7/project-builds/metaconfig-8e797a3467b5923cfd14ceefd02aa3f26e32123d/metaconfig-typesafe-config/src/main/scala/metaconfig/typesafeconfig/package.scala:11: value toFile is not a member of scala.meta.io.AbsolutePath
[metaconfig] [error]  Note: implicit value typesafeConfigMetaconfigParser is not applicable here because it comes after the application point and it lacks an explicit result type
[metaconfig] [error]         TypesafeConfig2Class.gimmeConfFromFile(path.toFile)
[metaconfig] [error]         TypesafeConfig2Class.gimmeConfFromFile(path.toFile)
[metaconfig] [error]                                                     ^
[metaconfig] [error]                                                     ^
[metaconfig] [error] one error found
[metaconfig] [error] (metaconfig-typesafe-config/compile:doc) Scaladoc generation failed
[metaconfig] [error] (metaconfig-typesafe-config/compile:compileIncremental) Compilation failed

@olafurpg this looks might it might be easily resolvable by having metaconfig use having the community build use a newer scalameta? and/or, how's that plan for scalafmt to abandon its metaconfig dependency coming...?

@SethTisue
Copy link
Member Author

with a newer scalameta,

[info] Project metaconfig--------------: SUCCESS (project rebuilt ok)

but then we also need a newer scalafix, and meta-paradise doesn't compile

@SethTisue
Copy link
Member Author

it looks like this is doomed because scalafmt wants scalameta 1.7 but scalafix wants 2.0 and there are definite source incompatibilities

or rather, doomed unless we use dbuild's spaces feature to keep this stuff separate

which might not be very hard actually. nothing down near the dependency trunk uses meta, just leaves or near-leaves, so splitting is okay

@olafurpg
Copy link

Scalafmt will likely be stuck on scalameta 1.7 for a while. The complications are caused by its dependency on scalameta/paradise, which we plan to sunset in favor of scalamacros/scalamacros soon. I think it's best to keep scalafmt out of the CB for now until the new macro annotations stabilize.

FWIW, scalafix recently dropped its dependency on scalameta/paradise macro annotations.

@SethTisue SethTisue removed their assignment Aug 10, 2017
@SethTisue SethTisue removed the on hold label Nov 13, 2017
@SethTisue
Copy link
Member Author

having refreshed my memory of how dbuild spaces work in order to accommodate the jawn 0.10/0.11 split, I'm (again) interested in revisiting this. scalafmt is core to the ecosystem, so I'd like to get it in if at all possible.

@olafurpg
Copy link

Heads up, scalafmt depends on an old version of scalameta (1.7) that is incompatible with scalameta 2.1 which scalafix depends on. I really wish this wasn't the case, but I'm afraid scalafmt v1.x is stuck on scalameta 1.x for the upcoming future unless I'm able to dedicate some work hours to do the fairly painful upgrade.

@SethTisue
Copy link
Member Author

Heads up, scalafmt depends on an old version of scalameta (1.7) that is incompatible with scalameta 2.1 which scalafix depends on

yeah I think I can build both versions of scalameta and keep them separate using dbuild's spaces feature. I think it's worth a try, anyway.

@SethTisue
Copy link
Member Author

if/when I tackle this I'll start over with a new PR

@SethTisue SethTisue closed this Nov 14, 2017
@SethTisue
Copy link
Member Author

@SethTisue SethTisue mentioned this pull request Nov 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants