-
Notifications
You must be signed in to change notification settings - Fork 52
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
Read sources files from sbt instead of scalaSource #41
Conversation
The change you've made would include both managed and unmanaged sources in the scalastyle analysis. If I understand correctly, this is reasonable in your case. I don't think this should be the default behaviour, though. Generated sources often have lots of style issues. Also, is there any reason why you're using the task (sources) rather than the setting (sourceDirectories)? I would suggest that we add a scalastyleSources setting with default value of Seq(scalaSource), which can then be overridden in the .sbt file to be sourceDirectories? What do you think? |
oh, I didn't know about Thanks for your time! |
Have you done the change? |
+1 As this would also enabled cross-compiled builds to work. For example, https://github.com/non/cats/tree/master/laws is cross compiled to JS and JVM, with shared code in the This will also we the case for spire, referenced in #42 by @rklaehn - eg https://github.com/non/spire/tree/master/core |
Hopefully I'll get some time to work on it this weekend. |
@matthewfarwell I've done updating this, could you take a look at it? |
It looks good to me, did you have a chance to look at my pull request for scalastyle (scalastyle/scalastyle#158)? |
@jkerfs Thanks for your comment. I have taken a look at your PR, your solution would benefit the control of which files to be checked. And since the current sbt plugin would only consider |
+1 I also have a cross-compiled project with sources in the |
Read sources files from sbt instead of scalaSource
Thanks! |
This is to enable us to run scalastyle with sources that are dynamically added when we are using sbt.
(for example, we can use sbt-maven-plugin and build-helper-maven-plugin to add some additional source file, check https://github.com/apache/spark/blob/master/sql/hive-thriftserver/pom.xml )
Originally, scalastyle-sbt-plugin would call scalaSource of sbt command to get all the files that need to be checked, but this would omit those file that not in
src/main/scala/{groupId}/xxx
.In this patch, we are calling sources of sbt command, and get all the files that the sbt would compile.
/cc @matthewfarwell
This is a solution to https://issues.apache.org/jira/browse/SPARK-4331