Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scalafix rule #58

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
18 changes: 18 additions & 0 deletions .scalafix.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
rules = [
RemoveUnused,
DisableSyntax,
NoAutoTupling,
LeakingImplicitClassVal,
NoValInForComprehension,
]

DisableSyntax.noFinalize = true

NoInfer.disabledTypes = [
scala.Any,
scala.AnyVal,
scala.Serializable,
java.io.Serializable,
scala.Product,
scala.Predef.any2stringadd
]
83 changes: 83 additions & 0 deletions 3rdparty/jvm/ch/epfl/scala/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
load("@rules_scala3//rules:scala.bzl", "scala_import")
scala_import(
name = "scalafix_cli",
jars = [
"//external:jar/ch/epfl/scala/scalafix_cli_3_5_1"
],
runtime_deps = [
"//3rdparty/jvm/com/martiansoftware:nailgun_server",
"//3rdparty/jvm/org/apache/commons:commons_text",
"//3rdparty/jvm/org/eclipse/jgit:org_eclipse_jgit",
"//3rdparty/jvm/org/scala_lang:scala3_library",
":scalafix_interfaces",
":scalafix_reflect",
":scalafix_rules"
],
visibility = [
"//visibility:public"
]
)

scala_import(
name = "scalafix_core",
jars = [
"//external:jar/ch/epfl/scala/scalafix_core_2_13"
],
runtime_deps = [
"//3rdparty/jvm/com/googlecode/java_diff_utils:diffutils",
"//3rdparty/jvm/org/scala_lang/modules:scala_collection_compat",
"//3rdparty/jvm/org/scala_lang:scala_library",
"//3rdparty/jvm/org/scalameta:metaconfig_typesafe_config",
"//3rdparty/jvm/org/scalameta:scalameta",
"//3rdparty/jvm/org/scalameta:semanticdb_shared"
],
visibility = [
"//3rdparty/jvm:__subpackages__"
]
)

java_import(
name = "scalafix_interfaces",
jars = [
"//external:jar/ch/epfl/scala/scalafix_interfaces"
],
runtime_deps = [
"//3rdparty/jvm/io/get_coursier:interface"
],
visibility = [
"//3rdparty/jvm:__subpackages__"
]
)

scala_import(
name = "scalafix_reflect",
jars = [
"//external:jar/ch/epfl/scala/scalafix_reflect_2_13_15"
],
runtime_deps = [
"//3rdparty/jvm/org/scala_lang:scala_compiler",
"//3rdparty/jvm/org/scala_lang:scala_library",
"//3rdparty/jvm/org/scala_lang:scala_reflect",
"//3rdparty/jvm/org/scalameta:semanticdb_scalac_core",
":scalafix_core"
],
visibility = [
"//3rdparty/jvm:__subpackages__"
]
)

scala_import(
name = "scalafix_rules",
jars = [
"//external:jar/ch/epfl/scala/scalafix_rules_3_5_1"
],
runtime_deps = [
"//3rdparty/jvm/io/get_coursier:interface",
"//3rdparty/jvm/org/scala_lang:scala3_library",
"//3rdparty/jvm/org/scala_lang:scala3_presentation_compiler",
":scalafix_core"
],
visibility = [
"//3rdparty/jvm:__subpackages__"
]
)
10 changes: 10 additions & 0 deletions 3rdparty/jvm/com/google/code/findbugs/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
load("@rules_scala3//rules:scala.bzl", "scala_import")
java_import(
name = "jsr305",
jars = [
"//external:jar/com/google/code/findbugs/jsr305"
],
visibility = [
"//3rdparty/jvm:__subpackages__"
]
)
10 changes: 10 additions & 0 deletions 3rdparty/jvm/com/google/code/gson/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
load("@rules_scala3//rules:scala.bzl", "scala_import")
java_import(
name = "gson",
jars = [
"//external:jar/com/google/code/gson/gson"
],
visibility = [
"//3rdparty/jvm:__subpackages__"
]
)
10 changes: 10 additions & 0 deletions 3rdparty/jvm/com/google/errorprone/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
load("@rules_scala3//rules:scala.bzl", "scala_import")
java_import(
name = "error_prone_annotations",
jars = [
"//external:jar/com/google/errorprone/error_prone_annotations"
],
visibility = [
"//3rdparty/jvm:__subpackages__"
]
)
38 changes: 38 additions & 0 deletions 3rdparty/jvm/com/google/guava/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
load("@rules_scala3//rules:scala.bzl", "scala_import")
java_import(
name = "failureaccess",
jars = [
"//external:jar/com/google/guava/failureaccess"
],
visibility = [
"//3rdparty/jvm:__subpackages__"
]
)

java_import(
name = "guava",
jars = [
"//external:jar/com/google/guava/guava"
],
runtime_deps = [
"//3rdparty/jvm/com/google/code/findbugs:jsr305",
"//3rdparty/jvm/com/google/errorprone:error_prone_annotations",
"//3rdparty/jvm/com/google/j2objc:j2objc_annotations",
"//3rdparty/jvm/org/checkerframework:checker_qual",
":failureaccess",
":listenablefuture"
],
visibility = [
"//3rdparty/jvm:__subpackages__"
]
)

java_import(
name = "listenablefuture",
jars = [
"//external:jar/com/google/guava/listenablefuture"
],
visibility = [
"//3rdparty/jvm:__subpackages__"
]
)
10 changes: 10 additions & 0 deletions 3rdparty/jvm/com/google/j2objc/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
load("@rules_scala3//rules:scala.bzl", "scala_import")
java_import(
name = "j2objc_annotations",
jars = [
"//external:jar/com/google/j2objc/j2objc_annotations"
],
visibility = [
"//3rdparty/jvm:__subpackages__"
]
)
10 changes: 10 additions & 0 deletions 3rdparty/jvm/com/google/protobuf/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
load("@rules_scala3//rules:scala.bzl", "scala_import")
java_import(
name = "protobuf_java",
jars = [
"//external:jar/com/google/protobuf/protobuf_java"
],
visibility = [
"//3rdparty/jvm:__subpackages__"
]
)
10 changes: 10 additions & 0 deletions 3rdparty/jvm/com/googlecode/java_diff_utils/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
load("@rules_scala3//rules:scala.bzl", "scala_import")
java_import(
name = "diffutils",
jars = [
"//external:jar/com/googlecode/java_diff_utils/diffutils"
],
visibility = [
"//3rdparty/jvm:__subpackages__"
]
)
10 changes: 10 additions & 0 deletions 3rdparty/jvm/com/googlecode/javaewah/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
load("@rules_scala3//rules:scala.bzl", "scala_import")
java_import(
name = "JavaEWAH",
jars = [
"//external:jar/com/googlecode/javaewah/JavaEWAH"
],
visibility = [
"//3rdparty/jvm:__subpackages__"
]
)
27 changes: 27 additions & 0 deletions 3rdparty/jvm/com/lihaoyi/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
load("@rules_scala3//rules:scala.bzl", "scala_import")
scala_import(
name = "fansi",
jars = [
"//external:jar/com/lihaoyi/fansi_2_13"
],
runtime_deps = [
"//3rdparty/jvm/org/scala_lang:scala_library",
":sourcecode"
],
visibility = [
"//3rdparty/jvm:__subpackages__"
]
)

scala_import(
name = "sourcecode",
jars = [
"//external:jar/com/lihaoyi/sourcecode_2_13"
],
runtime_deps = [
"//3rdparty/jvm/org/scala_lang:scala_library"
],
visibility = [
"//3rdparty/jvm:__subpackages__"
]
)
10 changes: 10 additions & 0 deletions 3rdparty/jvm/com/martiansoftware/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
load("@rules_scala3//rules:scala.bzl", "scala_import")
java_import(
name = "nailgun_server",
jars = [
"//external:jar/com/martiansoftware/nailgun_server"
],
visibility = [
"//3rdparty/jvm:__subpackages__"
]
)
30 changes: 30 additions & 0 deletions 3rdparty/jvm/com/thesamet/scalapb/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
load("@rules_scala3//rules:scala.bzl", "scala_import")
scala_import(
name = "lenses",
jars = [
"//external:jar/com/thesamet/scalapb/lenses_2_13"
],
runtime_deps = [
"//3rdparty/jvm/org/scala_lang/modules:scala_collection_compat",
"//3rdparty/jvm/org/scala_lang:scala_library"
],
visibility = [
"//3rdparty/jvm:__subpackages__"
]
)

scala_import(
name = "scalapb_runtime",
jars = [
"//external:jar/com/thesamet/scalapb/scalapb_runtime_2_13"
],
runtime_deps = [
"//3rdparty/jvm/com/google/protobuf:protobuf_java",
"//3rdparty/jvm/org/scala_lang/modules:scala_collection_compat",
"//3rdparty/jvm/org/scala_lang:scala_library",
":lenses"
],
visibility = [
"//3rdparty/jvm:__subpackages__"
]
)
10 changes: 10 additions & 0 deletions 3rdparty/jvm/com/typesafe/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
load("@rules_scala3//rules:scala.bzl", "scala_import")
java_import(
name = "config",
jars = [
"//external:jar/com/typesafe/config"
],
visibility = [
"//3rdparty/jvm:__subpackages__"
]
)
13 changes: 13 additions & 0 deletions 3rdparty/jvm/io/get_coursier/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
load("@rules_scala3//rules:scala.bzl", "scala_import")
java_import(
name = "interface",
jars = [
"//external:jar/io/get_coursier/interface"
],
runtime_deps = [
"//3rdparty/jvm/org/slf4j:slf4j_api"
],
visibility = [
"//3rdparty/jvm:__subpackages__"
]
)
10 changes: 10 additions & 0 deletions 3rdparty/jvm/io/github/java_diff_utils/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
load("@rules_scala3//rules:scala.bzl", "scala_import")
java_import(
name = "java_diff_utils",
jars = [
"//external:jar/io/github/java_diff_utils/java_diff_utils"
],
visibility = [
"//3rdparty/jvm:__subpackages__"
]
)
10 changes: 10 additions & 0 deletions 3rdparty/jvm/net/java/dev/jna/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
load("@rules_scala3//rules:scala.bzl", "scala_import")
java_import(
name = "jna",
jars = [
"//external:jar/net/java/dev/jna/jna"
],
visibility = [
"//3rdparty/jvm:__subpackages__"
]
)
23 changes: 23 additions & 0 deletions 3rdparty/jvm/org/apache/commons/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
load("@rules_scala3//rules:scala.bzl", "scala_import")
java_import(
name = "commons_lang3",
jars = [
"//external:jar/org/apache/commons/commons_lang3"
],
visibility = [
"//3rdparty/jvm:__subpackages__"
]
)

java_import(
name = "commons_math3",
jars = [
Expand All @@ -8,3 +18,16 @@ java_import(
"//3rdparty/jvm:__subpackages__"
]
)

java_import(
name = "commons_text",
jars = [
"//external:jar/org/apache/commons/commons_text"
],
runtime_deps = [
":commons_lang3"
],
visibility = [
"//3rdparty/jvm:__subpackages__"
]
)
10 changes: 10 additions & 0 deletions 3rdparty/jvm/org/checkerframework/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
load("@rules_scala3//rules:scala.bzl", "scala_import")
java_import(
name = "checker_qual",
jars = [
"//external:jar/org/checkerframework/checker_qual"
],
visibility = [
"//3rdparty/jvm:__subpackages__"
]
)
14 changes: 14 additions & 0 deletions 3rdparty/jvm/org/eclipse/jgit/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
load("@rules_scala3//rules:scala.bzl", "scala_import")
java_import(
name = "org_eclipse_jgit",
jars = [
"//external:jar/org/eclipse/jgit/org_eclipse_jgit"
],
runtime_deps = [
"//3rdparty/jvm/com/googlecode/javaewah:JavaEWAH",
"//3rdparty/jvm/org/slf4j:slf4j_api"
],
visibility = [
"//3rdparty/jvm:__subpackages__"
]
)
Loading
Loading