Uploaded image for project: 'PredictionIO (Retired)'
  1. PredictionIO (Retired)
  2. PIO-12

Adding some basic Scala style rules missed in scalastyle-config.xml

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.10.0-incubating
    • None
    • None

    Description

      It seems there are some missing basic style checking rules. For example,

      1. Removing tabs:

        <check level="error" class="org.scalastyle.file.FileTabChecker" enabled="true"></check>
      

      2. Checking Apache license in the header:

        <check level="error" class="org.scalastyle.file.HeaderMatchesChecker" enabled="true">
          <parameters>
             <parameter name="header"><![CDATA[/*
       * Licensed to the Apache Software Foundation (ASF) under one or more
       * contributor license agreements.  See the NOTICE file distributed with
       * this work for additional information regarding copyright ownership.
       * The ASF licenses this file to You under the Apache License, Version 2.0
       * (the "License"); you may not use this file except in compliance with
       * the License.  You may obtain a copy of the License at
       *
       *    http://www.apache.org/licenses/LICENSE-2.0
       *
       * Unless required by applicable law or agreed to in writing, software
       * distributed under the License is distributed on an "AS IS" BASIS,
       * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
       * See the License for the specific language governing permissions and
       * limitations under the License.
       */]]></parameter>
          </parameters>
        </check>
      

      3. Check non-ascii nodes

        <check level="error" class="org.scalastyle.scalariform.NonASCIICharacterChecker" enabled="true"></check>
      

      4. A space after comment start (See, SpaceAfterCommentStartChecker)

        <check level="error" class="org.scalastyle.scalariform.SpaceAfterCommentStartChecker" enabled="true"></check>
      

      5. Scala/Java documentation style check

      <check enabled="true" class="org.scalastyle.scalariform.ScalaDocChecker" level="error"></check>
      

      or

        <check customId="NoScalaDoc" level="error" class="org.scalastyle.file.RegexChecker" enabled="true">
          <parameters><parameter name="regex">(?m)^(\s*)/[*][*].*$(\r|)\n^\1  [*]</parameter></parameters>
          <customMessage>Use Javadoc style indentation for multiline comments</customMessage>
        </check>
      

      Attachments

        Issue Links

          Activity

            People

              dszeto Donald Szeto
              gurwls223 Hyukjin Kwon
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Slack

                  Issue deployment