From ec9eaf95c14540078c68376aa020e798103e053c Mon Sep 17 00:00:00 2001 From: Corey Woodfield Date: Fri, 24 May 2024 10:33:51 -0600 Subject: [PATCH 1/2] Make format default to True If I'm using scala_library from scala_with_scalafmt.bzl, odds are pretty good I want to format the scala code --- rules/scalafmt/private/test.bzl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rules/scalafmt/private/test.bzl b/rules/scalafmt/private/test.bzl index 80ca3ec6..3ae324a5 100644 --- a/rules/scalafmt/private/test.bzl +++ b/rules/scalafmt/private/test.bzl @@ -25,9 +25,7 @@ scala_non_default_format_attributes = { allow_single_file = True, default = "@rules_scala_annex//rules/scalafmt:testrunner", ), - "format": attr.bool( - default = False, - ), + "format": attr.bool(default = True), } def build_format(ctx): From 1376a9c1c9d95cdc276881c5a220ce3d622de4d0 Mon Sep 17 00:00:00 2001 From: Corey Woodfield Date: Fri, 24 May 2024 10:37:24 -0600 Subject: [PATCH 2/2] Make scala rules compatible with --compile_one_dependency see https://github.com/bazelbuild/bazel/issues/13419#issuecomment-1438581325 --- rules/scala.bzl | 1 + 1 file changed, 1 insertion(+) diff --git a/rules/scala.bzl b/rules/scala.bzl index 9c107d23..c7a569eb 100644 --- a/rules/scala.bzl +++ b/rules/scala.bzl @@ -90,6 +90,7 @@ _compile_attributes = { ".java", ".srcjar", ], + flags = ["DIRECT_COMPILE_TIME_INPUT"], ), "data": attr.label_list( doc = "The additional runtime files needed by this library.",