-
Notifications
You must be signed in to change notification settings - Fork 28.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-30030][INFRA] Use RegexChecker instead of TokenChecker to check org.apache.commons.lang.
#26666
Conversation
cc @databricks-david-lewis and @srowen |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, definitely. I think we cleaned this up a while ago, so this snuck back in. I thought we had a style rule about it but maybe I'm dreaming or it was disabled. It's used in the copy of the Hive thriftserver code, where we should probably leave it. So, yeah.
Thanks you, @srowen . Yes. I'll try to clean up the pom and dependency like this at this time. |
Oh, interesting. We have a rule for that. Let me dig the reason how this escape from the checker.
|
LGTM, sorry for letting it sneak back in! Maybe benchmark code is excluded from that check? |
Thank you for review, @databricks-david-lewis . |
regex
@@ -258,7 +258,7 @@ This file is divided into 3 sections: | |||
scala.collection.JavaConverters._ and use .asScala / .asJava methods</customMessage> | |||
</check> | |||
|
|||
<check customId="commonslang2" level="error" class="org.scalastyle.scalariform.TokenChecker" enabled="true"> | |||
<check customId="commonslang2" level="error" class="org.scalastyle.file.RegexChecker" enabled="true"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@srowen and @databricks-david-lewis . This was the root cause.
I'm not sure if there is any change inside TokenChecker
, but RegexChecker
is better at detecting org.apache.commons.lang.
since it's not a token.
Since the GitHub Action Linter passed with the new rule and the changed code, I'll merge this PR. Thank you, @srowen and @databricks-david-lewis . |
regex
org.apache.commons.lang.
…k `org.apache.commons.lang.` This PR replace `TokenChecker` with `RegexChecker` in `scalastyle` and fixes the missed instances. This will remove the old `comons-lang2` dependency from `core` module **BEFORE** ``` $ dev/scalastyle Scalastyle checks failed at following occurrences: [error] /Users/dongjoon/PRS/SPARK-SerializationUtils/core/src/test/scala/org/apache/spark/util/PropertiesCloneBenchmark.scala:23:7: Use Commons Lang 3 classes (package org.apache.commons.lang3.*) instead [error] of Commons Lang 2 (package org.apache.commons.lang.*) [error] Total time: 23 s, completed Nov 25, 2019 11:47:44 AM ``` **AFTER** ``` $ dev/scalastyle Scalastyle checks passed. ``` No. Pass the GitHub Action linter. Closes #26666 from dongjoon-hyun/SPARK-29081-2. Authored-by: Dongjoon Hyun <dhyun@apple.com> Signed-off-by: Dongjoon Hyun <dhyun@apple.com> (cherry picked from commit 38240a7) Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
This is backported to |
This comment has been minimized.
This comment has been minimized.
Test build #114425 has finished for PR 26666 at commit
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What changes were proposed in this pull request?
This PR replace
TokenChecker
withRegexChecker
inscalastyle
and fixes the missed instances.Why are the changes needed?
This will remove the old
comons-lang2
dependency fromcore
moduleBEFORE
AFTER
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Pass the GitHub Action linter.