scalastyle support ?

Is there any intention to support tools like scalastyle ? I'm using this one as a Maven plugin for QA. But it cranks out text. A little GUI would be nice. :-)

TIA

Jan

7 comments
Comment actions Permalink

You can create an issue to support it possibly like part of compiler or some other action.
I'm not sure if it possible to support in editor. Possibly you can create issues for every important inspection, it can be implemented for IntelliJ IDEA too.
Our tracker: http://youtrack.jetbrains.com/issues/SCL

Best regards,
Alexander Podkhalyuzin.

0
Comment actions Permalink

The Eclipse plugin for Scalastyle is not dependent upon the scala-ide, it doesn't interact with the presentation compiler at all. Scalastyle includes scalariform to parse the Scala code, so the plugin does everything separately. I don't know about  the Intellij plugin architecture, but I would have said it would be fairly simple.

Scalastyle requires a file as input and you need to implement a trait to get the output, the errors and warnings.

I would be keen to have an Intellij plugin as well, so if you've got any more questions, please don't hesitate.

Thanks.

Matthew Farwell
Scalastyle project lead.

0
Comment actions Permalink

We can give you not a file, but a String. Because text of file on a disk and file in Editor may be different (for a short time, but it's still true).
Anyway such plugin is quite simple to implement. Do you want to implement it by yourself (in this case I'll give all instructions), or you are considering to create on issue for us (this is a bit slower)?

Best regards,
Alexander Podkhalyuzin.

0
Comment actions Permalink

There is a method Checker#verifySource (https://github.com/scalastyle/scalastyle/blob/master/src/main/scala/org/scalastyle/Checker.scala) which takes a String rather than a File. The FileSpec is just a trait with a name() method.

I don't know anything about Intellij plugins. I could do it, but I think it would be a slow process. What would be the timescale if I were to raise an issue (approx: days, weeks, months, years?). Because if I did it, I think it would probably end up as months, what with all of the other stuff I've got at the minute.

What do you think? Do you think it's easy (in comparison with writing an Eclipse plugin) for someone who's not really used to Intellij?

The source for the Eclipse plugin is at https://github.com/scalastyle/scalastyle-plugin/blob/master/org.scalastyle.scalastyleplugin.core/src/org/scalastyle/scalastyleplugin/builder/ScalastyleBuilder.scala. This is the stuff for running Scalastyle anyway. There is other stuff for managing the configurations & creating the configuration files as well.

Please tell me what you think.

Thanks.

Matthew Farwell.

0
Comment actions Permalink

It will be much much more simpler even than Eclipse plugin;)
Ok, Let I'll do it ASAP (after fixing few Critical things and tests) for example part about running it anyway (just create an issue for me). Then when we will have something workable, we will be able to collaborate on other things. My thoughts that it will be much simpler to support it for you, then for us, so I think we have to collaborate anyway.

Best regards,
Alexander Podkhalyuzin.

0
Comment actions Permalink

Cool. Thanks.

I'll look forward to that.

Matthew Farwell.

0
Comment actions Permalink

I just pushed something very basic to https://github.com/Alefas/intellij-scalastyle
Actully I did it super-simple. My remarks:
1. Only default configuration. Stub for UI and settings bean class was created.
2. Always highlights compete line, because I don't know what to do with column member, as for me it would be better to have something like a range.
3. Highlighting is not working in not completed file (I mean file is not parsed correctly). This means that during typing highlighting will be removed and it will return back as file will be parsed correctly. This is due to exeptions in parser handling incorrect input.

So now you should better know what you want from plugin. And probably I missed something. I can answer for any question (my e-mail: Alexander.Podkhalyuzin@jetbrains.com). I also can move repository to your "Scalastyle" on GitHub (just leave me commit rights just in case).

How to configure it in IDEA (currently it's for IDEA 12, build 122.519, but it so simple that I'm sure it's compatible with IDEA 11 as well):
1. Open project.
2. Add global library "scala-plugin" containing only scala-plugin.jar from Scala plugin repository. (I'm sure this dependency is not necessary, but I think it's impossible to use Scalastyle plugin without Scala plugin and also probably this will be necessary in future, so I created this hard dependency).
3. Add IDEA SDK in your SDKs.

That's all. There is no usages of Maven or Ant, there is only configured artifact in IDEA. But it's produces workable plugin, which can be uploaded to plugins.intellij.net.
You can improve this in any way you want, only problem that Maven based project is incompatible with plugin module in IntelliJ IDEA. This can be fixed by using it like Java module like it's done in Scala plugin sources, but it ruquires a lot of work.

Best regards,
Alexander Podkhalyuzin.



Attachment(s):
scalastyle-plugin.zip
0

Please sign in to leave a comment.