Last active
October 26, 2018 08:52
-
-
Save onzo-dave-hinton/b0b745095036077ef3ef053f3102d978 to your computer and use it in GitHub Desktop.
I can't get scalafmt working through rules_scala_annex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bazel-* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
maxColumn = 120 | |
align = none | |
newlines.alwaysBeforeElseAfterCurlyIf = true | |
binPack.literalArgumentLists = false | |
rewrite.rules = [SortImports] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
load("@rules_scala_annex//rules:scala.bzl", "scala_library", "scala_binary", "scala_test") | |
load("@rules_scala_annex//rules:scalafmt.bzl", "scala_format_test") | |
scala_binary( | |
name="binary", | |
srcs=["Hello.scala"], | |
main_class="com.onzo.Hello", | |
) | |
scala_format_test( | |
name = "format", | |
srcs = glob(["**/*.scala"]), | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.onzo | |
object Hello | |
{ | |
def main(args: Array[String]) | |
: Unit | |
= | |
println( | |
"I'm a very badly-formatted Scala program" | |
) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# proto_library, cc_proto_library, and java_proto_library rules implicitly | |
# depend on @com_google_protobuf for protoc and proto runtimes. | |
# This statement defines the @com_google_protobuf repo. | |
http_archive( | |
name = "com_google_protobuf", | |
sha256 = "cef7f1b5a7c5fba672bec2a319246e8feba471f04dcebfe362d55930ee7c1c30", | |
strip_prefix = "protobuf-3.5.0", | |
urls = ["https://github.com/google/protobuf/archive/v3.5.0.zip"], | |
) | |
rules_scala_annex_commit = "b80e278392e264ec62aeedc44edd9b7fd19a9ce8" | |
rules_scala_annex_sha256 = "987d5907f2182fea677a5945ed733dd31edd892748f4b8c28e6d1b48889f316b" | |
http_archive( | |
name = "rules_scala_annex", | |
sha256 = rules_scala_annex_sha256, | |
strip_prefix = "rules_scala_annex-%s" % rules_scala_annex_commit, | |
url = "https://github.com/andyscott/rules_scala_annex/archive/%s.zip" % rules_scala_annex_commit, | |
) | |
load("@rules_scala_annex//rules/scala:workspace.bzl", "scala_register_toolchains", "scala_repository", "scala_repositories") | |
scala_repositories() | |
scala_register_toolchains() | |
scala_repository("scala", ("org.scala-lang", "2.12.7"), "@compiler_bridge_2_12//:src") | |
load("@rules_scala_annex//rules/scalafmt:workspace.bzl", "scalafmt_default_config", "scalafmt_repositories") | |
scalafmt_repositories() | |
scalafmt_default_config() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment