Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
style = IntelliJ
maxColumn = 100

project.excludeFilters = [
".*com/google/.*"
".*tech/sourced/featurext/generated/.*"
".*gopkg/in/.*"
]
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ matrix:

- scala: 2.11.2
env: STYLE_CHECK=true
script: ./sbt scalastyle
script: make lint-scala

- scala: 2.11.2
env: FE_PYTHON_TEST=true
Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,8 @@ format-python:

lint-python:
$(YAPF_CMD) --diff

lint-scala:
$(SBT) scalafmt::test
$(SBT) test:scalafmt::test
$(SBT) sbt:scalafmt::test
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,13 @@ To generate protobuf messages fixtures you may use [bblfsh-sdk-tools](https://gi
bblfsh-sdk-tools fixtures -p .proto -l <LANG> <path-to-source-code-file>
```

This project uses [scalafmt](http://scalameta.org/scalafmt) formatting.

To check if the code follows the project style, use the linters
```
make lint-scala
```

## License

Copyright (C) 2017 source{d}.
Expand Down
13 changes: 2 additions & 11 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,5 @@ publishTo := {
}
}

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)))
}
// Show diffs for sbt scalafmt::test
scalafmtShowDiff in (ThisBuild, scalafmt) := true
2 changes: 1 addition & 1 deletion project/plugins.sbt
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")
98 changes: 0 additions & 98 deletions scalastyle-config.xml

This file was deleted.