Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

Latest commit

 

History

History
29 lines (22 loc) · 587 Bytes

scalafmt.md

File metadata and controls

29 lines (22 loc) · 587 Bytes

Scalafmt

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

load("@rules_scala_annex//rules/scalafmt:workspace.bzl", "scalafmt_repositories", "scalafmt_default_config")
scalafmt_repositories()
scalafmt_default_config()

And in BUILD

load("@rules_scala_annex//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