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

Config loader methods removed in 1.6.0-RC1 #1204

Closed
nedtwigg opened this issue May 30, 2018 · 9 comments
Closed

Config loader methods removed in 1.6.0-RC1 #1204

nedtwigg opened this issue May 30, 2018 · 9 comments

Comments

@nedtwigg
Copy link
Contributor

nedtwigg commented May 30, 2018

Problem

Up until 0.6.8, you could load configuration with org.scalafmt.config.Config::fromHocon. From then until 1.6.0-rc1, you could use org.scalafmt.config.Config::fromHoconString. It seems these methods have been removed in 1.6.0-rc1, which causes breakage in downstream projects:

diffplug/spotless#252

Expectation

The transition from 1.5 to 1.6 won't have breaking API changes.

Workaround

We can find the new method names, and use those. Not a big deal :)

@nedtwigg nedtwigg changed the title Configuration loader methods removes in 1.6.0-RC1 Configuration loader methods removed in 1.6.0-RC1 May 30, 2018
@nedtwigg nedtwigg changed the title Configuration loader methods removed in 1.6.0-RC1 Config loader methods removed in 1.6.0-RC1 May 30, 2018
@olafurpg
Copy link
Member

Hei, thanks for reporting and thanks for spotless :) It's a great project.

The library compatibility story is that only org.scalafmt.Scalafmt guarantees binary and source compatibility between releases. You can use the following method instead

def parseHoconConfig(configString: String): Configured[ScalafmtConfig] =

The website contains examples how to load configuration this API https://scalameta.org/scalafmt/#Standalonelibrary

I'm sorry for the change, I was not aware this method was being used.

@olafurpg
Copy link
Member

olafurpg commented Jun 5, 2018

FYI @nedtwigg I opened #1212 to add back the fromHoconString(String,Option) overload since it was being used by another integration (#1206). However, I am committed to keep the API s in org.scalafmt.Scalafmt stable so I recommend using that instead. I'm happy to add more methods there if you are missing functionality from the API.

@nedtwigg
Copy link
Contributor Author

nedtwigg commented Jun 5, 2018

Dunno if or when migating to org.scalafmt.Scalafmt will make it to the top of one of our contributor's todo lists, but I'll be sure to leave it open. Thanks for fixing us in the meantime 👍

@olafurpg
Copy link
Member

olafurpg commented Jun 5, 2018

That's totally fair, I'll be sure to keep the old method around 😉

@olafurpg
Copy link
Member

olafurpg commented Jun 5, 2018

FYI v1.6.0-RC2 is out https://github.com/scalameta/scalafmt/releases/tag/v1.6.0-RC2 Please let me know if that fixes the issue.

@nedtwigg
Copy link
Contributor Author

nedtwigg commented Jun 5, 2018

@joan38 can you check that 1.6.0-RC2 fixes your problem?

@joan38
Copy link
Contributor

joan38 commented Jun 5, 2018

I will do tomorrow when I have access to a laptop.
Thanks

@joan38
Copy link
Contributor

joan38 commented Jul 9, 2018

It didn't work at the end. Not sure why.
Having a look with @nedtwigg on diffplug/spotless#260

@olafurpg
Copy link
Member

olafurpg commented Jul 9, 2018

@joan38 what is the error? I don't see what the problem is in the linked Spotless PR 🤔

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

No branches or pull requests

3 participants