数据湖DeltaLake编译scalastyle检查错误Failing because of negative scalastyle result

    技术2022-07-31  74

    delta编译报错很明显是scalastyle检查的问题,但是sbt不像maven有-skip可以不执行检查, 用scalastyle:on /scalastyle:off 太麻烦,只好把scalastyle-config.xml文件的内容全部清空

    $ build/sbt compile Using E:\dev_tools\jdk1.8.0_202\jdk as default JAVA_HOME. Note, this will be overridden by -java-home if it is set. Attempting to fetch sbt Launching sbt from build/sbt-launch-0.13.18.jar [info] Loading global plugins from C:\Users\Administrator\.sbt\0.13\plugins [info] Loading project definition from E:\code\github\delta\project\project [info] Loading project definition from E:\code\github\delta\project Missing bintray credentials C:\Users\Administrator\.bintray\.credentials. Some intray features depend on this. [info] Set current project to delta-core (in build file:/E:/code/github/delta/) [info] Executing in batch mode. For better performance use sbt's shell [info] scalastyle using config E:\code\github\delta\scalastyle-config.xml [error] E:\code\github\delta\src\main\scala\org\apache\spark\sql\delta\DeltaTimTravelSpec.scala:59:6: [error] Are you sure that you want to throw Error? In most cases, you shold use appropriate Exception instead. [error] If you must throw Error, wrap the code block with [error] // scalastyle:off throwerror [error] throw new XXXError(...) [error] // scalastyle:on throwerror [error] [error] E:\code\github\delta\src\main\scala\org\apache\spark\sql\delta\schema\ShemaUtils.scala:179:22: [error] Are you sure that you want to use toUpperCase or toLowerCase withut the root locale? In most cases, you [error] should use toUpperCase(Locale.ROOT) or toLowerCase(Locale.ROOT) istead. [error] If you must use toUpperCase or toLowerCase without the root local, wrap the code block with [error] // scalastyle:off caselocale [error] .toUpperCase [error] .toLowerCase [error] // scalastyle:on caselocale [error] [error] E:\code\github\delta\src\main\scala\org\apache\spark\sql\delta\schema\ShemaUtils.scala:252:26: [error] Are you sure that you want to use toUpperCase or toLowerCase withut the root locale? In most cases, you [error] should use toUpperCase(Locale.ROOT) or toLowerCase(Locale.ROOT) istead. [error] If you must use toUpperCase or toLowerCase without the root local, wrap the code block with [error] // scalastyle:off caselocale [error] .toUpperCase [error] .toLowerCase [error] // scalastyle:on caselocale [error] [error] E:\code\github\delta\src\main\scala\org\apache\spark\sql\delta\schema\ShemaUtils.scala:916:98: [error] Are you sure that you want to use toUpperCase or toLowerCase withut the root locale? In most cases, you [error] should use toUpperCase(Locale.ROOT) or toLowerCase(Locale.ROOT) istead. [error] If you must use toUpperCase or toLowerCase without the root local, wrap the code block with [error] // scalastyle:off caselocale [error] .toUpperCase [error] .toLowerCase [error] // scalastyle:on caselocale [error] [error] E:\code\github\delta\src\main\scala\org\apache\spark\sql\delta\schema\ShemaUtils.scala:921:4: [error] Are you sure that you want to use toUpperCase or toLowerCase withut the root locale? In most cases, you [error] should use toUpperCase(Locale.ROOT) or toLowerCase(Locale.ROOT) istead. [error] If you must use toUpperCase or toLowerCase without the root local, wrap the code block with [error] // scalastyle:off caselocale [error] .toUpperCase [error] .toLowerCase [error] // scalastyle:on caselocale [error] [error] E:\code\github\delta\src\main\scala\org\apache\spark\sql\delta\Snapshotscala:305:58: [error] Are you sure that you want to throw Error? In most cases, you shold use appropriate Exception instead. [error] If you must throw Error, wrap the code block with [error] // scalastyle:off throwerror [error] throw new XXXError(...) [error] // scalastyle:on throwerror [error] [error] E:\code\github\delta\src\main\scala\org\apache\spark\sql\delta\util\FilNames.scala:100:22: [error] Are you sure that you want to throw Error? In most cases, you shold use appropriate Exception instead. [error] If you must throw Error, wrap the code block with [error] // scalastyle:off throwerror [error] throw new XXXError(...) [error] // scalastyle:on throwerror [error] [error] E:\code\github\delta\src\main\scala\org\apache\spark\sql\delta\util\ParitionUtils.scala:703:47: [error] Are you sure that you want to use toUpperCase or toLowerCase withut the root locale? In most cases, you [error] should use toUpperCase(Locale.ROOT) or toLowerCase(Locale.ROOT) istead. [error] If you must use toUpperCase or toLowerCase without the root local, wrap the code block with [error] // scalastyle:off caselocale [error] .toUpperCase [error] .toLowerCase [error] // scalastyle:on caselocale [error] [info] scalastyle Processed 95 file(s) [info] scalastyle Found 8 errors [info] scalastyle Found 0 warnings [info] scalastyle Found 0 infos [info] scalastyle Finished in 9 ms [success] created output: E:\code\github\delta\target java.lang.RuntimeException: Failing because of negative scalastyle result at scala.sys.package$.error(package.scala:27) at org.scalastyle.sbt.Tasks$.handleResult$1(Plugin.scala:132) at org.scalastyle.sbt.Tasks$.doScalastyleWithConfig$1(Plugin.scala:187) at org.scalastyle.sbt.Tasks$.doScalastyle(Plugin.scala:192) at org.scalastyle.sbt.ScalastylePlugin$$anonfun$rawScalastyleSettings$1$anonfun$apply$1$$anonfun$apply$2.apply(Plugin.scala:81) at org.scalastyle.sbt.ScalastylePlugin$$anonfun$rawScalastyleSettings$1$anonfun$apply$1$$anonfun$apply$2.apply(Plugin.scala:68) at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47) at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40) at sbt.std.Transform$$anon$4.work(System.scala:63) at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:28) at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:28) at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17) at sbt.Execute.work(Execute.scala:237) at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228) at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228) at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestritions.scala:159) at sbt.CompletionService$$anon$2.call(CompletionService.scala:28) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:51) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutorjava:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecuto.java:624) at java.lang.Thread.run(Thread.java:748) [error] (*:compileScalastyle) Failing because of negative scalastyle result [error] Total time: 2 s, completed 2020-6-30 11:21:56

     

    Processed: 0.011, SQL: 10