Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.5.0
    • Component/s: Project Infra
    • Labels:
    • Target Version/s:

      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:

        <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>
      

        Attachments

          Activity

            People

            • Assignee:
              jonalter Jon Alter
              Reporter:
              rxin Reynold Xin
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: