Remove deprecations (#43)
We don't have to follow the same deprecations they do upstream.
Personally I think the recommendation to move to buildifier_test for
diffing isn't always ideal, since it requires you to manually provide
all files vs running over everything in your repo.
diff --git a/buildifier/factory.bzl b/buildifier/factory.bzl
index 0735f4d..1d9b1e4 100644
--- a/buildifier/factory.bzl
+++ b/buildifier/factory.bzl
@@ -4,29 +4,6 @@
load("@bazel_skylib//lib:shell.bzl", "shell")
-# buildifier: disable=print
-def _value_deprecation(ctx, attr, value):
- """
- Prints a deprecation message related to a specific value for an attr.
-
- Args:
- ctx: The execution context
- attr: A String representing the attribute name
- value: The deprecated value
- """
- print("DEPRECATION NOTICE: value '%s' for attribute '%s' will be removed in the future. Migrate '%s' to buildifier_test." % (value, attr, ctx.label))
-
-# buildifier: disable=print
-def _attr_deprecation(ctx, attr):
- """
- Prints an attribute deprecation message.
-
- Args:
- ctx: The execution context
- attr: A String representing the deprecated attribute name
- """
- print("DEPRECATION NOTICE: attribute '%s' will be removed in the future. Migrate '%s' to buildifier_test." % (attr, ctx.label))
-
def buildifier_attr_factory(test_rule = False):
"""
Helper macro to generate a struct of attrs for use in a rule() definition.
@@ -115,10 +92,6 @@
Returns:
A DefaultInfo provider
"""
-
- if not test_rule and ctx.attr.mode in ["check", "diff", "print_if_changed"]:
- _value_deprecation(ctx, "mode", ctx.attr.mode)
-
args = [
"-mode=%s" % ctx.attr.mode,
"-v=%s" % str(ctx.attr.verbose).lower(),
@@ -134,13 +107,9 @@
if ctx.attr.multi_diff:
args.append("-multi_diff")
- if not test_rule:
- _attr_deprecation(ctx, "multi_diff")
if ctx.attr.diff_command:
args.append("-diff_command=%s" % ctx.attr.diff_command)
- if not test_rule:
- _attr_deprecation(ctx, "diff_command")
if ctx.attr.add_tables:
args.append("-add_tables=%s" % ctx.file.add_tables.path)
diff --git a/examples/simple/BUILD b/examples/simple/BUILD
index 906cf2a..3036700 100644
--- a/examples/simple/BUILD
+++ b/examples/simple/BUILD
@@ -12,6 +12,7 @@
"all",
"-cc-native",
],
+ mode = "diff",
)
buildifier_test(