softwaremill / scala-clippy

Good advice for Scala compiler errors
Apache License 2.0
312 stars 20 forks source link

Add advice from resources #23

Closed ShaneDelmore closed 7 years ago

ShaneDelmore commented 7 years ago

This pr updates clippy to collect advice from all clippy.json files in resources. It also returns all matching advice, that way if multiple library authors register help for the same message (say .toJson not found) then we can display all of their advice and allow the user to choose.

ShaneDelmore commented 7 years ago

If this is acceptable then once it is published I will make PRs to a few libraries I use and see if I can get them to pull in the advice. Let me know if you have any suggested libraries to start with.

ShaneDelmore commented 7 years ago

CompileTests.scala work for me locally running sbt test, but fail on Travis. Not sure why yet.

ShaneDelmore commented 7 years ago

It looks like the master branch is also failing on travis. I am rebasing my changes back onto release 3.1 which looks like the last successful build on Travis.

ShaneDelmore commented 7 years ago

I have verified I get a green build when reverting the 2.12 clippy changes. https://travis-ci.org/softwaremill/scala-clippy/builds/175406394

adamw commented 7 years ago

Thanks! First, let me look at the failing 2.12 build :)

ShaneDelmore commented 7 years ago

It was ScalaTest causing the failure. I wasn't able to narrow it down beyond that.

adamw commented 7 years ago

Yeah, but locally everything works, which makes debugging a bit hard. And we do want 2.12 compatibility :) I'm trying with a newer version of scalatest now.

adamw commented 7 years ago

Ok, travis build fixed, there was an old scala version used in the .travis.yml file. Could you rebase your changes to master?

ShaneDelmore commented 7 years ago

No problem, I can do it in an hour or two.

ShaneDelmore commented 7 years ago

I will make an update in a day or two about adding advice in clippy.json. I will also reach out to a few library authors once it is published and see if they are receptive to me adding clippy advice and tests to their repos.

ShaneDelmore commented 7 years ago

I added minimal information to the readme on including library specific advice. Once it is published and I can verify the concept works well for my internal libraries I would like to extend the web interface to show the json produced and reference that in the readme as a way for library authors to easily create the Advice they need.

ShaneDelmore commented 7 years ago

Updated to implement feedback from @adamw

adamw commented 7 years ago

0.3.2 released - should be available shortly

ShaneDelmore commented 7 years ago

0.3.2 compiler plugin is available but no sbt plugin. I don't actually use the sbt-plugin anymore, just double checked since it failed to deploy last time.

adamw commented 7 years ago

Ah thanks! It got published this time, but for Scala 2.11, which isn't used by SBT ;) Fixing this now