This repository has been archived by the owner on Jan 30, 2023. It is now read-only.
/ sonar-scala Public archive
Upgrade Scalastyle to 1.1.0. #342
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge.
I finally found some time to fork and publish a new version of Scalastyle.
See the release notes and the following thread for more details.
This PR updates Scalastyle to the new version. Here are the changes as far as the rules repository and the quality profiles in SonarQube are concerned:
New Scalastyle rules:
ForLoopCheckerrule - omit braces if you have a
yieldclause, otherwise, surround the contents with curly-braces, even if the contents are only a single line.
WhileBraceChecker- rule - it's recommended to never omit braces when using
CaseBraceCheckerrule - braces aren't required in
Scalastyle rule changes:
HeaderMatchesCheckerhas new parameter
regexto indicate whether to treat the header string as a regular expression; defaults to
MethodLengthCheckerhas new parameter
ignoreEmptyto exclude empty lines from being counted; defaults to
ForBraceCheckerhas a new parameter
singleLineAllowedto indicate whether a one-line
forexpressions with parentheses are allowed.
NonASCIICharacterCheckerhas a new parameter
allowStringLiteralsto indicate whether non-ASCII scripts in string literals should be allowed.
It's getting difficult to keep track of the count of how many templates, non-template rules and template instances there are, so this diff of the generated inspections file between 1.0 and 1.1 was really useful in figuring that out.