Skip to content

Conversation

@lw-lin
Copy link
Contributor

@lw-lin lw-lin commented Apr 14, 2016

What changes were proposed in this pull request?

  • automatically build and install custom rules
  • added a custom rule PublicAbstractMethodsHaveTypeChecker implementation, which would ensure public abstract methods have explicit return types

How was this patch tested?

the list of changes-to-make found by this PublicAbstractMethodsHaveTypeChecker rule is here: https://github.com/apache/spark/pull/12389/files

@SparkQA
Copy link

SparkQA commented Apr 14, 2016

Test build #55821 has finished for PR 12396 at commit fb54cde.

  • This patch fails RAT tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@lw-lin
Copy link
Contributor Author

lw-lin commented Apr 14, 2016

As per Scalastyle - Custom rules, I installed the jar on my local machine, and verified that the added rule works.

Now I'm not sure how to pre-install the jar for every Spark build on Jenkins's machine -- should some build scripts be modified? @rxin could you give some hints? Thank you! :-)

@lw-lin lw-lin changed the title [WIP][SPARK-14629][SPARK-14630] Add support for custom scala style rules & Add rule PublicAbstractMethodsHaveTypeChecker [WIP][SPARK-14629][SPARK-14630][Build] Add support for custom scala style rules & Add rule PublicAbstractMethodsHaveTypeChecker Apr 14, 2016
<dependencies>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>scala_style_checker</artifactId>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yikes, do we have to maintain and publish this as a module to use it? it may not be worth it

Copy link
Contributor Author

@lw-lin lw-lin Apr 15, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@srowen yeah I think you're right -- doing that is heavy and not worth it. :-)
I'm working on a light-weight manner to do this, after all all we need is to install the custom rules jar locally in the dev & build environment, other than publishing that into run-time environment or maven-central.
Thanks for the review!

@SparkQA
Copy link

SparkQA commented Apr 14, 2016

Test build #55823 has finished for PR 12396 at commit 460efd3.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

asfgit pushed a commit that referenced this pull request Apr 14, 2016
…t methods should have explicit return types

## What changes were proposed in this pull request?

Currently many public abstract methods (in abstract classes as well as traits) don't declare return types explicitly, such as in [o.a.s.streaming.dstream.InputDStream](https://github.com/apache/spark/blob/master/streaming/src/main/scala/org/apache/spark/streaming/dstream/InputDStream.scala#L110):
```scala
def start() // should be: def start(): Unit
def stop()  // should be: def stop(): Unit
```

These methods exist in core, sql, streaming; this PR fixes them.

## How was this patch tested?

N/A

## Which piece of scala style rule led to the changes?

the rule was added separately in #12396

Author: Liwei Lin <[email protected]>

Closes #12389 from lw-lin/public-abstract-methods.
@lw-lin
Copy link
Contributor Author

lw-lin commented Apr 15, 2016

hi @vanzin
I'm not sure how to build and pre-install some jar for every Spark build on Jenkins's machine -- should some build scripts be modified? Could you give some hints when you have time? Thanks! :-)

(with some custom rules jar being built and pre-installed, we then can enable custom code style checks, please see http://www.scalastyle.org/custom-rules.html)

@rxin
Copy link
Contributor

rxin commented Apr 15, 2016

we can push this into scalastyle and then upgrade the version.

@vanzin
Copy link
Contributor

vanzin commented Apr 15, 2016

@lw-lin I don't know either, but that sounds like too much work for style rules. I suggest following Reynold's advice and posting a PR to the scalastyle project; they're a little slow to update things, though.

@lw-lin
Copy link
Contributor Author

lw-lin commented Apr 15, 2016

I see; will follow @rxin 's advise. So I'm closing this.

@rxin @vanzin @srowen thank you all for the comments! :-)

@lw-lin lw-lin closed this Apr 15, 2016
@lw-lin lw-lin deleted the custom-rules branch April 15, 2016 06:59
@lw-lin lw-lin changed the title [WIP][SPARK-14629][SPARK-14630][Build] Add support for custom scala style rules & Add rule PublicAbstractMethodsHaveTypeChecker [WON"T MERGE][SPARK-14629][SPARK-14630][Build] Add support for custom scala style rules & Add rule PublicAbstractMethodsHaveTypeChecker Apr 19, 2016
@lw-lin lw-lin changed the title [WON"T MERGE][SPARK-14629][SPARK-14630][Build] Add support for custom scala style rules & Add rule PublicAbstractMethodsHaveTypeChecker [WIP][SPARK-14629][SPARK-14630][Build] Add support for custom scala style rules & Add rule PublicAbstractMethodsHaveTypeChecker Apr 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants