-
Notifications
You must be signed in to change notification settings - Fork 15
Repace Scalastyle with scalafmt #74
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| style = IntelliJ | ||
|
|
||
| project.excludeFilters = [ | ||
| ".*com/google/.*" | ||
| ".*tech/sourced/featurext/generated/.*" | ||
| ".*gopkg/in/.*" | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,10 +12,8 @@ libraryDependencies ++= Seq( | |
| scalaTest % Test, | ||
| scoverage % Test, | ||
| spark % Test, | ||
|
|
||
| sparkSql % Provided, | ||
| fixNewerHadoopClient % Provided, //due to newer v. of guava | ||
|
|
||
| scalaLib % Compile, | ||
| scalapb % Compile, | ||
| scalapbGrpc % Compile, | ||
|
|
@@ -29,15 +27,16 @@ libraryDependencies ++= Seq( | |
| log4j12 % Compile, | ||
| log4jBinding % Compile | ||
| ) | ||
| assemblyOption in assembly := (assemblyOption in assembly).value.copy(includeScala = false) | ||
| assemblyOption in assembly := (assemblyOption in assembly).value | ||
| .copy(includeScala = false) | ||
| assemblyJarName in assembly := s"${name.value}-uber.jar" | ||
|
|
||
| assemblyMergeStrategy in assembly := { | ||
| case "META-INF/io.netty.versions.properties" => MergeStrategy.last | ||
| // engine uses bblfsh client scala, which also uses scalapb but different version | ||
| case PathList("scalapb", xs @ _*) => MergeStrategy.first | ||
| case PathList("scalapb", xs @ _*) => MergeStrategy.first | ||
| case PathList("com", "trueaccord", "lenses", xs @ _*) => MergeStrategy.first | ||
| case PathList("com", "google", "protobuf", xs @ _*) => MergeStrategy.first | ||
| case PathList("com", "google", "protobuf", xs @ _*) => MergeStrategy.first | ||
| case x => | ||
| val oldStrategy = (assemblyMergeStrategy in assembly).value | ||
| oldStrategy(x) | ||
|
|
@@ -49,7 +48,11 @@ assemblyShadeRules in assembly := Seq( | |
|
|
||
| test in assembly := {} | ||
| testOptions in Test += Tests.Argument(TestFrameworks.ScalaTest, "-oUT") | ||
| testOptions in Test += Tests.Argument(TestFrameworks.ScalaTest, "-l", "Cassandra") | ||
| testOptions in Test += Tests.Argument( | ||
| TestFrameworks.ScalaTest, | ||
| "-l", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above - this is not usefull
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @bzz from my understanding scalafmt tries to do the same what prettier did for javascript. Yes, it doesn't always make useful changes but consistent. I personally 100% in to sacrifice readability in exchange to consistent code style. (although about readability some people can disagree with you)
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consistency is 👍 but autoformatter shall adhere the language styleguide and make things easier to read and maintain, not harder. If we get back to discussing particular case at hand: following a common sense and the styleguide http://docs.scala-lang.org/style/indentation.html#methods-with-numerous-arguments it seems to me that this change should not happen. Or did I miss something here?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure if it's the case here. But most probably it is. The line is more than 80 character in length. Most probably it's a reason to break arguments to multiple lines.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PS.
is also subjectively. I remember a huge holywar about new elements on new line in a list. vs I think the first variant is better, but surprisingly most of people in the issue voted for the second one. |
||
| "Cassandra" | ||
| ) | ||
|
|
||
| parallelExecution in Test := false | ||
| fork in Test := true //Forking is required for the Embedded Cassandra | ||
|
|
@@ -59,27 +62,37 @@ sonatypeProfileName := "tech.sourced" | |
|
|
||
| // pom settings for sonatype | ||
| homepage := Some(url("https://github.com/src-d/gemini")) | ||
| scmInfo := Some(ScmInfo(url("https://github.com/src-d/gemini"), | ||
| "git@github.com:src-d/gemini.git")) | ||
| developers += Developer("bzz", | ||
| scmInfo := Some( | ||
| ScmInfo( | ||
| url("https://github.com/src-d/gemini"), | ||
| "git@github.com:src-d/gemini.git" | ||
| ) | ||
| ) | ||
| developers += Developer( | ||
| "bzz", | ||
| "Alexander Bezzubov", | ||
| "alex@sourced.tech", | ||
| url("https://github.com/bzz")) | ||
| url("https://github.com/bzz") | ||
| ) | ||
| licenses += ("GPLv3", url("https://www.gnu.org/licenses/gpl.html")) | ||
| pomIncludeRepository := (_ => false) | ||
|
|
||
| crossPaths := false | ||
| publishMavenStyle := true | ||
|
|
||
| val SONATYPE_USERNAME = scala.util.Properties.envOrElse("SONATYPE_USERNAME", "NOT_SET") | ||
| val SONATYPE_PASSWORD = scala.util.Properties.envOrElse("SONATYPE_PASSWORD", "NOT_SET") | ||
| val SONATYPE_USERNAME = | ||
| scala.util.Properties.envOrElse("SONATYPE_USERNAME", "NOT_SET") | ||
| val SONATYPE_PASSWORD = | ||
| scala.util.Properties.envOrElse("SONATYPE_PASSWORD", "NOT_SET") | ||
| credentials += Credentials( | ||
| "Sonatype Nexus Repository Manager", | ||
| "oss.sonatype.org", | ||
| SONATYPE_USERNAME, | ||
| SONATYPE_PASSWORD) | ||
| SONATYPE_PASSWORD | ||
| ) | ||
|
|
||
| val SONATYPE_PASSPHRASE = scala.util.Properties.envOrElse("SONATYPE_PASSPHRASE", "not set") | ||
| val SONATYPE_PASSPHRASE = | ||
| scala.util.Properties.envOrElse("SONATYPE_PASSPHRASE", "not set") | ||
|
|
||
| useGpg := false | ||
| pgpSecretRing := baseDirectory.value / "project" / ".gnupg" / "secring.gpg" | ||
|
|
@@ -96,15 +109,3 @@ publishTo := { | |
| Some("releases" at nexus + "service/local/staging/deploy/maven2") | ||
| } | ||
| } | ||
|
|
||
| scalastyleSources in Compile := { | ||
| // all .scala files in "src/main/scala" | ||
| val scalaSourceFiles = ((scalaSource in Compile).value ** "*.scala").get | ||
| val fSep = java.io.File.separator | ||
| val dirsNameToExclude = List( | ||
| "com" + fSep + "google", | ||
| "tech" + fSep + "sourced" + fSep + "featurext" + fSep + "generated", | ||
| "gopkg" + fSep + "in" | ||
| ) | ||
| scalaSourceFiles.filterNot(f => dirsNameToExclude.exists(dir => f.getAbsolutePath.contains(dir))) | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.5") | ||
| addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.8.2") | ||
| addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1") | ||
| addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "1.0.0") | ||
| addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "5.2.2") | ||
| addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0") | ||
| addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "1.1") | ||
| addSbtPlugin("com.lucidchart" % "sbt-scalafmt" % "1.15") |
This file was deleted.
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.
I suggest we