You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Reynold Xin (JIRA)" <ji...@apache.org> on 2015/06/04 08:47:38 UTC

[jira] [Updated] (SPARK-7977) Disallow println

     [ https://issues.apache.org/jira/browse/SPARK-7977?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Reynold Xin updated SPARK-7977:
-------------------------------
    Description: 
Very often we see pull requests that added println from debugging, but the author forgot to remove it before code review.

We can use the regex checker to disallow println. For legitimate use of println, we can then disable the rule where they are used.

Add to scalastyle-config.xml file:
{code}
  <check customId="println" level="error" class="org.scalastyle.scalariform.TokenChecker" enabled="true">
    <parameters><parameter name="regex">^println$</parameter></parameters>
    <customMessage><![CDATA[Are you sure you want to println? If yes, wrap the code block with 
      // scalastyle:off println
      println(...)
      // scalastyle:on println]]></customMessage>
  </check>
{code}


  was:
Very often we see pull requests that added println from debugging, but the author forgot to remove it before code review.

We can use the regex checker to disallow println. For legitimate use of println, we can then disable the rule.

Add to scalastyle-config.xml file:
{code}
  <check customId="println" level="error" class="org.scalastyle.scalariform.TokenChecker" enabled="true">
    <parameters><parameter name="regex">^println$</parameter></parameters>
    <customMessage><![CDATA[Are you sure you want to println? If yes, wrap the code block with 
      // scalastyle:off println
      println(...)
      // scalastyle:on println]]></customMessage>
  </check>
{code}



> Disallow println
> ----------------
>
>                 Key: SPARK-7977
>                 URL: https://issues.apache.org/jira/browse/SPARK-7977
>             Project: Spark
>          Issue Type: Sub-task
>          Components: Project Infra
>            Reporter: Reynold Xin
>              Labels: starter
>
> Very often we see pull requests that added println from debugging, but the author forgot to remove it before code review.
> We can use the regex checker to disallow println. For legitimate use of println, we can then disable the rule where they are used.
> Add to scalastyle-config.xml file:
> {code}
>   <check customId="println" level="error" class="org.scalastyle.scalariform.TokenChecker" enabled="true">
>     <parameters><parameter name="regex">^println$</parameter></parameters>
>     <customMessage><![CDATA[Are you sure you want to println? If yes, wrap the code block with 
>       // scalastyle:off println
>       println(...)
>       // scalastyle:on println]]></customMessage>
>   </check>
> {code}



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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org