      }
      ctx.actions.expand_template(
          template = ctx.file._runner,
-@@ -167,6 +181,8 @@ def buildifier_impl_factory(ctx, test_rule = False):
+@@ -167,6 +180,8 @@ def buildifier_impl_factory(ctx, test_rule = False):
      runfiles = [ctx.executable.buildifier]
      if test_rule:
          runfiles.extend(ctx.files.srcs)

+        kwargs["tags"] = tags
+    _buildifier_test(**kwargs)
diff --git a/buildifier/internal/factory.bzl b/buildifier/internal/factory.bzl
index 779c789..0ae3bc1 100644
--- a/buildifier/internal/factory.bzl
+++ b/buildifier/internal/factory.bzl
@@ -46,6 +46,10 @@ def buildifier_attr_factory(test_rule = False):

         "mode": attr.string(
             default = "fix" if not test_rule else "diff",
             doc = "Formatting mode",
@@ -80,7 +84,6 @@ def buildifier_attr_factory(test_rule = False):
     if test_rule:
         attrs.update({
             "srcs": attr.label_list(
-                allow_empty = False,
                 allow_files = [
                     ".bazel",
                     ".bzl",
@@ -91,12 +94,13 @@ def buildifier_attr_factory(test_rule = False):
                 ],
                 doc = "A list of labels representing the starlark files to include in the test",
             ),
