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

Parsing sources with trailing commas (supported since Scala 2.12.2+) #276

Open
nktpro opened this issue Aug 27, 2017 · 17 comments
Open

Parsing sources with trailing commas (supported since Scala 2.12.2+) #276

nktpro opened this issue Aug 27, 2017 · 17 comments

Comments

@nktpro
Copy link

nktpro commented Aug 27, 2017

Scala 2.12.2+ added support for trailing commas. However scalastyle currently doesn't parse source files correctly when trailing commas are used. An error similarly to "Expected identifier, but got Token(RPAREN,),xxx,))" is thrown.

As a very simple example:

package foo.bar

object TrailingCommaTest {
  def trailingCommaTest(
    foo: String,
    bar: Boolean,
  ) = {}
}
@canoztokmak
Copy link
Contributor

It looks like a scalariform issue.. The exception you receive is thrown by scalariform parser.. It would be great if you file an issue here.

@matthewfarwell
Copy link
Member

It is unfortunately true that we are dependent upon scalariform here. We'll need to get them to change it.

@JoshRosen
Copy link
Contributor

I've commented on a Scalariform PR to push for making incremental progress here: if Scalaiform can get to a point where the parser doesn't crash, even if preservation of trailing commas doesn't work during automated reformatting, then that unblocks a fix here in Scalastyle (solving the problem for folks who use only Scalastyle and not Scalariform) and solves a huge usability issue (confusing error messages). See scala-ide/scalariform#262 (comment)

@godenji
Copy link

godenji commented Feb 8, 2019

Scalariform 0.2.7 has been released (with trailing comma support).

@SethTisue
Copy link
Contributor

#332 does the upgrade

@adam-ah
Copy link

adam-ah commented Feb 13, 2019

Any news on when this might be fixed/released?

@SethTisue
Copy link
Contributor

hmm, the contributions graph at https://github.com/matthewfarwell doesn't look promising. silence at https://twitter.com/matthewfarwell also

anyone know Matthew IRL and could ask him if he could anoint additional maintainers?

@zatekusen
Copy link

Is there any update on this? It is quite annoying since the error message does not even show where the violation is - may take a while to find out.

@SethTisue
Copy link
Contributor

issue on new release is #327

@matthewfarwell merged #332 a couple days ago

@anilkumarmyla
Copy link

Looking forward to this fix for a long time. @matthewfarwell can you help release a new version or annoint additional maintainers who can help regarding this?

@anilkumarmyla
Copy link

There seems to be no activity on this thread for 2 weeks already. What are our options?

@gmarti
Copy link

gmarti commented Mar 26, 2019

There seems to be no activity on this thread for 2 weeks already. What are our options?

Fork ?
I have no answer for 1 year on #290

@mwz
Copy link

mwz commented Mar 26, 2019

I've asked for a new release many times now e.g. here and here, but unfortunately had no luck. @matthewfarwell @ScrapCodes @y-yoshinoya are you guys still maintaining this repo? If you need any help, I'm sure there are many people in the community who would be willing to help out and maintain this project.

@zatekusen
Copy link

Any one has a workaround for this in gradle? Can we override the scalariform dependency version in the scalastyle gradle plugin?

@BardurArantsson
Copy link

BardurArantsson commented May 18, 2019

Maybe it's time to just fork under a new domain name, even if it's just for a single release?

@niebloomj
Copy link

This is still an active issue for my team.

@BardurArantsson
Copy link

This comment may be of interest: #327 (comment)

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

No branches or pull requests