Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-13583

Remove unused imports and add checkstyle rule

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 2.0.0
    • DStreams, Spark Core
    • None

    Description

      After SPARK-6990, `dev/lint-java` keeps Java code healthy and helps PR review by saving much time.

      This issue aims to enforce `UnusedImports` rule by adding a `UnusedImports` rule to `checkstyle.xml` and fixing all existing unused imports.

      checkstyle.xml
      +        <module name="UnusedImports"/>
      

      Unfortunately, `dev/lint-java` is not tested by Jenkins. ( https://github.com/apache/spark/blob/master/dev/run-tests.py#L546 )

      This will also help Spark contributors to check by themselves before submitting their PRs.

      According to the srowen's comments, this PR also includes the removal of unused imports in Scala code. It will be done by manually because of the following two reasons.

      Attachments

        Activity

          People

            dongjoon Dongjoon Hyun
            dongjoon Dongjoon Hyun
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: