[ 
https://issues.apache.org/jira/browse/PIO-12?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15403729#comment-15403729
 ] 

ASF GitHub Bot commented on PIO-12:
-----------------------------------

GitHub user HyukjinKwon opened a pull request:

    https://github.com/apache/incubator-predictionio/pull/264

    [PIO-12] Add a rule for checking Scala documentation style

    This PR adds the rule for checking Scala documentation style.
    
    This rule will check below:
    
    - Wrong
    
    ```
    /**
     *
    ...
    ```
    
    - Correct
    
    ```
    /**
      *
    ...
    ```
    
    We can't just enable `org.scalastyle.scalariform.ScalaDocChecker` because 
it forces  all the classes, traits, methods, types and properties to have 
documentation which is overwhelming.
    
    I ran the checking and then corrected the Java style documentation to Scala 
documentation according to http://docs.scala-lang.org/style/scaladoc.html.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/HyukjinKwon/incubator-predictionio 
PIO-12-scaladoc

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-predictionio/pull/264.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #264
    
----
commit 951f320fd376987d6df3343dc810bbe002099010
Author: hyukjinkwon <[email protected]>
Date:   2016-08-02T10:21:50Z

    Add a rule for checking Scala documentation style

----


> Adding some basic Scala style rules missed in scalastyle-config.xml
> -------------------------------------------------------------------
>
>                 Key: PIO-12
>                 URL: https://issues.apache.org/jira/browse/PIO-12
>             Project: PredictionIO
>          Issue Type: Improvement
>            Reporter: Hyukjin Kwon
>            Assignee: Donald Szeto
>             Fix For: 0.10.0
>
>
> It seems there are some missing basic style checking rules. For example,
> 1. Removing tabs:
> {code}
>   <check level="error" class="org.scalastyle.file.FileTabChecker" 
> enabled="true"></check>
> {code}
> 2. Checking Apache license in the header:
> {code}
>   <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>
> {code}
> 3. Check non-ascii nodes
> {code}
>   <check level="error" 
> class="org.scalastyle.scalariform.NonASCIICharacterChecker" 
> enabled="true"></check>
> {code}
> 4. A space after comment start (See, 
> [SpaceAfterCommentStartChecker|http://www.scalastyle.org/rules-dev.html#org_scalastyle_scalariform_SpaceAfterCommentStartChecker])
> {code}
>   <check level="error" 
> class="org.scalastyle.scalariform.SpaceAfterCommentStartChecker" 
> enabled="true"></check>
> {code}
> 5. Scala/Java documentation style check
> {code}
> <check enabled="true" class="org.scalastyle.scalariform.ScalaDocChecker" 
> level="error"></check>
> {code}
> or
> {code}
>   <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>
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to