Skip to content

Latest commit

 

History

History
28 lines (21 loc) · 523 Bytes

scalafmt.md

File metadata and controls

28 lines (21 loc) · 523 Bytes

Scalafmt

Create .scalafmt.conf at the repo root (may be empty). And add to the WORKSPACE

load("@rules_scala3//rules/scalafmt:config.bzl", "scalafmt_repositories")
scalafmt_default_config()

And in BUILD

load("@rules_scala3//rules:scalafmt.bzl", "scala_format_test")
scala_format_test(
    name = "format",
    srcs = glob(["**/*.scala"]),
)

Then

# check format, with diffs and non-zero exit in case of differences
$ bazel test :format

# format files in-place
$ bazel run :format