]> source.dussan.org Git - jgit.git/commitdiff
Bazel: Fix lint warning flagged by buildifier 11/144311/2
authorDavid Ostrovsky <david@ostrovsky.org>
Tue, 18 Jun 2019 07:37:51 +0000 (09:37 +0200)
committerDavid Ostrovsky <david@ostrovsky.org>
Tue, 18 Jun 2019 07:43:08 +0000 (09:43 +0200)
This change is fixing confusing name warning: [1].

  ./org.eclipse.jgit.test/tests.bzl:12: confusing-name:
  Never use 'l', 'I', or 'O' as names (they're too easily confused
  with 'I', 'l', or '0').

And is also fixing: "All calls to rules or macros should pass arguments
by keyword position argument" warning: [2].

  ./org.eclipse.jgit.test/BUILD:42: positional-args: All calls to rules
  or macros should pass arguments by keyword (arg_name=value) syntax.

[1] https://github.com/bazelbuild/buildtools/blob/master/WARNINGS.md#confusing-name
[2] https://github.com/bazelbuild/buildtools/blob/master/WARNINGS.md#positional-args

Change-Id: If5c28ec8a1ddc1d1b1035bd07b838a2a564aea4f
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
org.eclipse.jgit.test/BUILD
org.eclipse.jgit.test/tests.bzl

index 5c0540fb9ba01f8dc261275d389ff9c447ac6f7b..1d03afe71de533da60014e4f505b8d456dcea2b6 100644 (file)
@@ -39,7 +39,7 @@ DATA = [
 
 RESOURCES = glob(["resources/**"])
 
-tests(glob(
+tests(tests = glob(
     ["tst/**/*.java"],
     exclude = HELPERS + DATA,
 ))
index d639a5bea14fd65e63fc1a41f8522bfd51f78507..17a45ca4b2b0b42843d9039b0cb7b16555e0c1b9 100644 (file)
@@ -9,14 +9,14 @@ def tests(tests):
         labels = []
         timeout = "moderate"
         if name.startswith("org_eclipse_jgit_"):
-            l = name[len("org.eclipse.jgit_"):]
-            if l.startswith("internal_storage_"):
-                l = l[len("internal.storage_"):]
-            i = l.find("_")
-            if i > 0:
-                labels.append(l[:i])
+            package = name[len("org.eclipse.jgit_"):]
+            if package.startswith("internal_storage_"):
+                package = package[len("internal.storage_"):]
+            index = package.find("_")
+            if index > 0:
+                labels.append(package[:index])
             else:
-                labels.append(i)
+                labels.append(index)
         if "lib" not in labels:
             labels.append("lib")