1

I'm using the maven plugin for scalastyle.

The Scalastyle site lists EnsureSingleSpaceAfterTokenChecker as one of the new checkers, but doesn't give an example of how to use it.

I'm sure it's used like typical checkers, but I'm not sure how to configure the parameters.

Does anyone know how to configure it?

Is this legit?

<check enabled="true" class="org.scalastyle.scalariform.EnsureSingleSpaceAfterTokenChecker" level="warning">
    <parameters>
        <parameter name="token">for</parameter>
    </parameters>
</check>

Edit: What I have doesn't seem to be working. There's not error, but it doesn't catch a violation in my code.

Inbl
  • 630
  • 2
  • 5
  • 18

1 Answers1

1

You must choose the tokens from here: https://github.com/mdr/scalariform/blob/master/scalariform/src/main/scala/scalariform/lexer/Tokens.scala

(Your example should work if you write an upercase "FOR").

Also, the name of the parameter is "tokens", not "token".

Quizzie
  • 879
  • 4
  • 15