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 trailing commas in sbt files #1103

Merged
merged 1 commit into from Jan 26, 2018

Conversation

2 participants
@dwijnand
Contributor

dwijnand commented Jan 24, 2018

Fixes #1098

Please review mercilessly, I'm happy to iterate.

@olafurpg

Minor comments, otherwise looks great. Thanks @dwijnand !

@@ -89,6 +89,6 @@ object ScalafmtRunner {
*/
val statement = default.copy(parser = scala.meta.parsers.Parse.parseStat)
val sbt = default.copy(dialect = scala.meta.dialects.Sbt0137)
val sbt = default

This comment has been minimized.

@olafurpg

olafurpg Jan 25, 2018

Member

Can we do forSbt here?

class ScalafmtRunnerTest extends FunSuite {
test("sbt dialect supports trailing commas") {
val code = ScalafmtRunner.sbt.forSbt

This comment has been minimized.

@olafurpg

olafurpg Jan 25, 2018

Member

.sbt.forSbt looks weird

)
.parse[Source]
.get
assert(code != null)

This comment has been minimized.

@olafurpg

olafurpg Jan 25, 2018

Member

Remove, parse will never return null

This comment has been minimized.

@dwijnand

dwijnand Jan 26, 2018

Contributor

I thought I needed this to make the types align, but guess with scalatest.FunSuite you don't. Done.

@olafurpg

LGTM 👍 Thank you @dwijnand !

@olafurpg olafurpg merged commit 542a045 into scalameta:master Jan 26, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@dwijnand dwijnand deleted the dwijnand:tc branch Jan 26, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment