From 7cce4e570c229f8365eb8cde1ff8fc576fab496a Mon Sep 17 00:00:00 2001 From: baifuyu Date: Tue, 12 Dec 2023 16:30:21 +0800 Subject: [PATCH 1/2] bugfix --- .github/CODEOWNERS | 10 +- pom.xml | 26 +++ scalastyle-config.xml | 446 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 478 insertions(+), 4 deletions(-) create mode 100644 scalastyle-config.xml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 9f40cde8a..5d6dfa588 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -9,9 +9,11 @@ # is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express # or implied. -@baifuyu +@baifuyu @leywar @yixianlzz -/cloudext fuyu.bfy@antgroup.com -/python qy266141@antgroup.com matthew.hyx@antgroup.com fuyu.bfy@antgroup.com -/reasoner donghai.ydh@antgroup.com fuyu.bfy@antgroup.com chengqiang.cq@antgroup.com peilong.zpl@antgroup.com wangshaofei.wsf@antgroup.com chushi.zj@antgroup.com zhizhen.lzz@antgroup.com +/cloudext fuyu.bfy@antgroup.com leywar.liang@antgroup.com +/python qy266141@antgroup.com julin.jl@antgroup.com leywar.liang@antgroup.com +/reasoner donghai.ydh@antgroup.com chengqiang.cq@antgroup.com peilong.zpl@antgroup.com zhizhen.lzz@antgroup.com +/builder fuyu.bfy@antgroup.com leywar.liang@antgroup.com +/server fuyu.bfy@antgroup.com matthew.hyx@antgroup.com leywar.liang@antgroup.com diff --git a/pom.xml b/pom.xml index 1c17b700f..f51b085da 100644 --- a/pom.xml +++ b/pom.xml @@ -47,6 +47,8 @@ 4.0.6 20231018-OPENSOURCE 1.2.11 + UTF-8 + UTF-8 2.11 2.11.12 2.2-M1-groovy-3.0 @@ -454,6 +456,30 @@ + + org.scalastyle + scalastyle-maven-plugin + 1.0.0 + + false + true + false + false + ${project.basedir}/src/main/scala + ${project.basedir}/src/test/scala + scalastyle-config.xml + ${project.basedir}/target/scalastyle-output.xml + ${project.build.sourceEncoding} + ${project.reporting.outputEncoding} + + + + + check + + + + com.diffplug.spotless spotless-maven-plugin diff --git a/scalastyle-config.xml b/scalastyle-config.xml new file mode 100644 index 000000000..9a3ac40d5 --- /dev/null +++ b/scalastyle-config.xml @@ -0,0 +1,446 @@ + + + + Scalastyle standard configuration + + + + + + + + + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ARROW, EQUALS, ELSE, TRY, CATCH, FINALLY, LARROW, RARROW + + + + + + ARROW, EQUALS, COMMA, COLON, IF, ELSE, DO, WHILE, FOR, MATCH, TRY, CATCH, FINALLY, LARROW, RARROW + + + + + + + + + + + ^FunSuite[A-Za-z]*$ + + Tests must extend org.apache.spark.SparkFunSuite instead. + + + + + + ^println$ + + + + + + + spark(.sqlContext)?.sparkContext.hadoopConfiguration + + + + + + + @VisibleForTesting + + + + + + + Runtime\.getRuntime\.addShutdownHook + + + + + + + mutable\.SynchronizedBuffer + + + + + + + Class\.forName + + + + + + + Await\.result + + + + + + + Await\.ready + + + + + + + (\.toUpperCase|\.toLowerCase)(?!(\(|\(Locale.ROOT\))) + + + + + + + throw new \w+Error\( + + + + + + + + JavaConversions + + Instead of importing implicits in scala.collection.JavaConversions._, import + scala.collection.JavaConverters._ and use .asScala / .asJava methods + + + + + + org\.apache\.commons\.lang\. + + Use Commons Lang 3 classes (package org.apache.commons.lang3.*) instead + of Commons Lang 2 (package org.apache.commons.lang.*) + + + + + + FileSystem.get\([a-zA-Z_$][a-zA-Z_$0-9]*\) + + + + + + + extractOpt + + Use jsonOption(x).map(.extract[T]) instead of .extractOpt[T], as the latter + is slower. + + + + + + java,scala,3rdParty,kgreasoner + javax?\..* + scala\..* + (?!com\.antfin\.aikg\.kgreasoner\.).* + com\.antfin\.aikg\.kgreasoner\..* + + + + + + COMMA + + + + + + + \)\{ + + + + + + + (?m)^(\s*)/[*][*].*$(\r|)\n^\1 [*] + + Use Javadoc style indentation for multiline comments + + + + + case[^\n>]*=>\s*\{ + + Omit braces in case clauses. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 800> + + + + + + + 30 + + + + + + + 10 + + + + + + + 50 + + + + + + + + + + + + + + + -1,0,1,2,3 + + + + + + Objects.toStringHelper + + Avoid using Object.toStringHelper. Use ToStringBuilder instead. + + From a5060595141bbab04a41ac790caf692107ec91b1 Mon Sep 17 00:00:00 2001 From: baifuyu Date: Tue, 12 Dec 2023 16:34:15 +0800 Subject: [PATCH 2/2] fix license --- scalastyle-config.xml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scalastyle-config.xml b/scalastyle-config.xml index 9a3ac40d5..acbc14a77 100644 --- a/scalastyle-config.xml +++ b/scalastyle-config.xml @@ -1,3 +1,16 @@ + +