Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Mismatched documentation for some rules #173

Open
GerretS opened this issue May 3, 2021 · 1 comment
Open

Mismatched documentation for some rules #173

GerretS opened this issue May 3, 2021 · 1 comment

Comments

@GerretS
Copy link

GerretS commented May 3, 2021

On https://scalastyle.beautiful-scala.com/rules-1.5.0.html, for the rules:

  • DisallowSpaceAfterTokenChecker
  • DisallowSpaceBeforeTokenChecker
  • EnsureSingleSpaceAfterTokenChecker
  • EnsureSingleSpaceBeforeTokenChecker
  • ImportOrderChecker

Under the header "Parameters" it says no parameters, but all of these have parameters in the Example Configuration that follows directly.

Could you please clarify whether these rules take parameters or not?

@mwz
Copy link
Member

mwz commented May 4, 2021

Hi Gerret, that's a good find.
The first four take a parameter named tokens just like in the examples. It appears that this parameter is not listed in the scalastyle_definition.xml file which is used to generate the documentation (worth adding it if that's something you'd like to contribute?). Changing the defaults in your custom config should work regardless of this parameter missing from the docs. It also looks like the defaults match up with the examples except for EnsureSingleSpaceBeforeTokenChecker which confusingly has empty tokens (see here).

The ImportOrderChecker rule takes an arbitrary number of parameters based on the value of the groups parameter as shown in the example, so I can imagine its specification in scalastyle_definition.xml was deliberately omitted because the parameters are dynamic.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants