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
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,13 @@ format-python:

lint-python:
$(YAPF_CMD) --diff

format-scala:
$(SBT) scalafmt
$(SBT) test:scalafmt
$(SBT) sbt:scalafmt

lint-scala:
$(SBT) scalafmt::test
$(SBT) test:scalafmt::test
$(SBT) sbt:scalafmt::test
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,18 @@ 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. You can configure IntelliJ IDEA to use the same formatting configuration. To do so, follow the [scalafmt instructions](http://scalameta.org/scalafmt/#IntelliJ).

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

To fix formatting issues, use the formatters
```
make format-scala
```

## License

Copyright (C) 2017 source{d}.
Expand Down
12 changes: 0 additions & 12 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,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)))
}
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.