GitHub user weiqingy opened a pull request:
https://github.com/apache/spark/pull/15960
[SPARK-18521] Add `NoRedundantStringInterpolator` Scala rule
## What changes were proposed in this pull request?
This PR is to add a new scala style rule 'NoRedundantStringInterpolator' to
prevent unnecessary string interpolators.
- Add the `NoRedundantStringInterpolator` rule in `scalastyle-config.xml`.
```
<check customId="NoRedundantStringInterpolator" level="error"
class="org.scalastyle.file.RegexChecker" enabled="true">
<parameters><parameter
name="regex">(?<=[\s(])s"[^\$\n"]*"(?![\w"])</parameter></parameters>
<customMessage>Do not use s string interpolator when no embed variable
reference
is in the processed string literals.</customMessage>
</check>
```
- Fix the current cases which can not pass
the`NoRedundantStringInterpolator` rule.
## How was this patch tested?
Pass the Jenkins tests and Scala style checking (`./dev/lint-scala`).
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/weiqingy/spark SPARK-18521
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/15960.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #15960
----
commit 357dd8f92d2ba0c5e38227f953b83b8eaeea8580
Author: Weiqing Yang <[email protected]>
Date: 2016-11-21T07:40:14Z
[SPARK-18521] Add `NoRedundantStringInterpolator` Scala rule
commit e428487ffedc3aa406295babcef058a81ac0d7af
Author: Weiqing Yang <[email protected]>
Date: 2016-11-21T08:13:25Z
Update PR after rebase
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]