From 214d26060c0186858699e27dffa194303acf95ba Mon Sep 17 00:00:00 2001 From: Alex Rodionov Date: Fri, 22 Mar 2024 14:37:08 -0700 Subject: [PATCH] [bazel] Move apple_rules_lint to MODULE --- MODULE.bazel | 12 +++ MODULE.bazel.lock | 248 ++++++++++++++++++++++++++++------------------ WORKSPACE.bzlmod | 19 ---- 3 files changed, 165 insertions(+), 114 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index 2c9f22fdd3d84..cfe168fecca58 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -1,5 +1,6 @@ module(name = "selenium") +bazel_dep(name = "apple_rules_lint", version = "0.3.2") bazel_dep(name = "contrib_rules_jvm", version = "0.24.0") bazel_dep(name = "platforms", version = "0.0.8") bazel_dep(name = "rules_dotnet", version = "0.14.0") @@ -9,6 +10,17 @@ bazel_dep(name = "rules_python", version = "0.31.0") bazel_dep(name = "rules_ruby", version = "0.8.1") bazel_dep(name = "rules_rust", version = "0.40.0") +linter = use_extension("@apple_rules_lint//lint:extensions.bzl", "linter") +linter.configure( + name = "java-spotbugs", + config = "//java:spotbugs-config", +) +linter.configure( + name = "rust-rustfmt", + config = "//rust:enable-rustfmt", +) +linter.register(name = "rust-rustfmt") + dotnet = use_extension("@rules_dotnet//dotnet:extensions.bzl", "dotnet") dotnet.toolchain(dotnet_version = "7.0.400") use_repo(dotnet, "dotnet_toolchains") diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 59ba5f560b70c..7b4d608ac4adc 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -1,6 +1,6 @@ { "lockFileVersion": 6, - "moduleFileHash": "350c3f1a73bf582c646ad72db044dc650df18d520ac67e21838961e115248ac2", + "moduleFileHash": "3d47da0b7af8fc4cf9261f382a83800b2e00b8b7e323cf19f510fe76c5c5ac94", "flags": { "cmdRegistries": [ "https://bcr.bazel.build/" @@ -29,13 +29,67 @@ "@rust_toolchains//:all" ], "extensionUsages": [ + { + "extensionBzlFile": "@apple_rules_lint//lint:extensions.bzl", + "extensionName": "linter", + "usingModule": "", + "location": { + "file": "@@//:MODULE.bazel", + "line": 13, + "column": 23 + }, + "imports": {}, + "devImports": [], + "tags": [ + { + "tagName": "configure", + "attributeValues": { + "name": "java-spotbugs", + "config": "//java:spotbugs-config" + }, + "devDependency": false, + "location": { + "file": "@@//:MODULE.bazel", + "line": 14, + "column": 17 + } + }, + { + "tagName": "configure", + "attributeValues": { + "name": "rust-rustfmt", + "config": "//rust:enable-rustfmt" + }, + "devDependency": false, + "location": { + "file": "@@//:MODULE.bazel", + "line": 18, + "column": 17 + } + }, + { + "tagName": "register", + "attributeValues": { + "name": "rust-rustfmt" + }, + "devDependency": false, + "location": { + "file": "@@//:MODULE.bazel", + "line": 22, + "column": 16 + } + } + ], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + }, { "extensionBzlFile": "@rules_dotnet//dotnet:extensions.bzl", "extensionName": "dotnet", "usingModule": "", "location": { "file": "@@//:MODULE.bazel", - "line": 12, + "line": 24, "column": 23 }, "imports": { @@ -51,7 +105,7 @@ "devDependency": false, "location": { "file": "@@//:MODULE.bazel", - "line": 13, + "line": 25, "column": 17 } } @@ -65,7 +119,7 @@ "usingModule": "", "location": { "file": "@@//:MODULE.bazel", - "line": 16, + "line": 28, "column": 31 }, "imports": { @@ -82,7 +136,7 @@ "usingModule": "", "location": { "file": "@@//:MODULE.bazel", - "line": 21, + "line": 33, "column": 23 }, "imports": { @@ -99,7 +153,7 @@ "devDependency": false, "location": { "file": "@@//:MODULE.bazel", - "line": 22, + "line": 34, "column": 17 } }, @@ -111,7 +165,7 @@ "devDependency": false, "location": { "file": "@@//:MODULE.bazel", - "line": 26, + "line": 38, "column": 17 } }, @@ -123,7 +177,7 @@ "devDependency": false, "location": { "file": "@@//:MODULE.bazel", - "line": 27, + "line": 39, "column": 17 } }, @@ -135,7 +189,7 @@ "devDependency": false, "location": { "file": "@@//:MODULE.bazel", - "line": 28, + "line": 40, "column": 17 } } @@ -149,7 +203,7 @@ "usingModule": "", "location": { "file": "@@//:MODULE.bazel", - "line": 31, + "line": 43, "column": 20 }, "imports": { @@ -167,7 +221,7 @@ "devDependency": false, "location": { "file": "@@//:MODULE.bazel", - "line": 34, + "line": 46, "column": 14 } }, @@ -181,7 +235,7 @@ "devDependency": false, "location": { "file": "@@//:MODULE.bazel", - "line": 34, + "line": 46, "column": 14 } }, @@ -195,7 +249,7 @@ "devDependency": false, "location": { "file": "@@//:MODULE.bazel", - "line": 34, + "line": 46, "column": 14 } }, @@ -209,7 +263,7 @@ "devDependency": false, "location": { "file": "@@//:MODULE.bazel", - "line": 34, + "line": 46, "column": 14 } } @@ -223,7 +277,7 @@ "usingModule": "", "location": { "file": "@@//:MODULE.bazel", - "line": 51, + "line": 63, "column": 32 }, "imports": { @@ -250,7 +304,7 @@ "usingModule": "", "location": { "file": "@@//:MODULE.bazel", - "line": 67, + "line": 79, "column": 22 }, "imports": { @@ -336,7 +390,7 @@ "devDependency": false, "location": { "file": "@@//:MODULE.bazel", - "line": 68, + "line": 80, "column": 14 } } @@ -350,7 +404,7 @@ "usingModule": "", "location": { "file": "@@//:MODULE.bazel", - "line": 143, + "line": 155, "column": 21 }, "imports": { @@ -369,7 +423,7 @@ "devDependency": false, "location": { "file": "@@//:MODULE.bazel", - "line": 144, + "line": 156, "column": 15 } }, @@ -466,7 +520,7 @@ "devDependency": false, "location": { "file": "@@//:MODULE.bazel", - "line": 148, + "line": 160, "column": 18 } } @@ -480,7 +534,7 @@ "usingModule": "", "location": { "file": "@@//:MODULE.bazel", - "line": 240, + "line": 252, "column": 21 }, "imports": { @@ -499,7 +553,7 @@ "devDependency": false, "location": { "file": "@@//:MODULE.bazel", - "line": 241, + "line": 253, "column": 15 } } @@ -513,7 +567,7 @@ "usingModule": "", "location": { "file": "@@//:MODULE.bazel", - "line": 247, + "line": 259, "column": 22 }, "imports": { @@ -533,7 +587,7 @@ "devDependency": false, "location": { "file": "@@//:MODULE.bazel", - "line": 248, + "line": 260, "column": 17 } } @@ -543,6 +597,7 @@ } ], "deps": { + "apple_rules_lint": "apple_rules_lint@0.3.2", "contrib_rules_jvm": "contrib_rules_jvm@0.24.0", "platforms": "platforms@0.0.8", "rules_dotnet": "rules_dotnet@0.14.0", @@ -555,6 +610,52 @@ "local_config_platform": "local_config_platform@_" } }, + "apple_rules_lint@0.3.2": { + "name": "apple_rules_lint", + "version": "0.3.2", + "key": "apple_rules_lint@0.3.2", + "repoName": "apple_rules_lint", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [ + { + "extensionBzlFile": "@apple_rules_lint//lint:extensions.bzl", + "extensionName": "linter", + "usingModule": "apple_rules_lint@0.3.2", + "location": { + "file": "https://bcr.bazel.build/modules/apple_rules_lint/0.3.2/MODULE.bazel", + "line": 9, + "column": 23 + }, + "imports": { + "apple_linters": "apple_linters" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "bazel_skylib": "bazel_skylib@1.5.0", + "io_bazel_stardoc": "stardoc@0.5.6", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "/~https://github.com/apple/apple_rules_lint/archive/refs/tags/0.3.2.tar.gz" + ], + "integrity": "sha256-fDzEWpXj72+8SEpCNHiaAn4RUZ9FTfY8u5Y6xJnxA/k=", + "strip_prefix": "apple_rules_lint-0.3.2", + "remote_patches": {}, + "remote_patch_strip": 0 + } + } + }, "contrib_rules_jvm@0.24.0": { "name": "contrib_rules_jvm", "version": "0.24.0", @@ -1928,35 +2029,19 @@ "bazel_tools": "bazel_tools@_" } }, - "apple_rules_lint@0.3.2": { - "name": "apple_rules_lint", - "version": "0.3.2", - "key": "apple_rules_lint@0.3.2", - "repoName": "apple_rules_lint", + "bazel_skylib@1.5.0": { + "name": "bazel_skylib", + "version": "1.5.0", + "key": "bazel_skylib@1.5.0", + "repoName": "bazel_skylib", "executionPlatformsToRegister": [], - "toolchainsToRegister": [], - "extensionUsages": [ - { - "extensionBzlFile": "@apple_rules_lint//lint:extensions.bzl", - "extensionName": "linter", - "usingModule": "apple_rules_lint@0.3.2", - "location": { - "file": "https://bcr.bazel.build/modules/apple_rules_lint/0.3.2/MODULE.bazel", - "line": 9, - "column": 23 - }, - "imports": { - "apple_linters": "apple_linters" - }, - "devImports": [], - "tags": [], - "hasDevUseExtension": false, - "hasNonDevUseExtension": true - } + "toolchainsToRegister": [ + "//toolchains/unittest:cmd_toolchain", + "//toolchains/unittest:bash_toolchain" ], + "extensionUsages": [], "deps": { - "bazel_skylib": "bazel_skylib@1.5.0", - "io_bazel_stardoc": "stardoc@0.5.6", + "platforms": "platforms@0.0.8", "bazel_tools": "bazel_tools@_", "local_config_platform": "local_config_platform@_" }, @@ -1965,28 +2050,27 @@ "ruleClassName": "http_archive", "attributes": { "urls": [ - "/~https://github.com/apple/apple_rules_lint/archive/refs/tags/0.3.2.tar.gz" + "/~https://github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz" ], - "integrity": "sha256-fDzEWpXj72+8SEpCNHiaAn4RUZ9FTfY8u5Y6xJnxA/k=", - "strip_prefix": "apple_rules_lint-0.3.2", + "integrity": "sha256-zVWgYudjuTSZIfD124w5MyiNyLpPdt2UFqrGis7jy5Q=", + "strip_prefix": "", "remote_patches": {}, "remote_patch_strip": 0 } } }, - "bazel_skylib@1.5.0": { - "name": "bazel_skylib", - "version": "1.5.0", - "key": "bazel_skylib@1.5.0", - "repoName": "bazel_skylib", + "stardoc@0.5.6": { + "name": "stardoc", + "version": "0.5.6", + "key": "stardoc@0.5.6", + "repoName": "stardoc", "executionPlatformsToRegister": [], - "toolchainsToRegister": [ - "//toolchains/unittest:cmd_toolchain", - "//toolchains/unittest:bash_toolchain" - ], + "toolchainsToRegister": [], "extensionUsages": [], "deps": { - "platforms": "platforms@0.0.8", + "bazel_skylib": "bazel_skylib@1.5.0", + "rules_java": "rules_java@7.4.0", + "rules_license": "rules_license@0.0.8", "bazel_tools": "bazel_tools@_", "local_config_platform": "local_config_platform@_" }, @@ -1995,9 +2079,9 @@ "ruleClassName": "http_archive", "attributes": { "urls": [ - "/~https://github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz" + "/~https://github.com/bazelbuild/stardoc/releases/download/0.5.6/stardoc-0.5.6.tar.gz" ], - "integrity": "sha256-zVWgYudjuTSZIfD124w5MyiNyLpPdt2UFqrGis7jy5Q=", + "integrity": "sha256-37w2Sq7BQ99ebFL68fEWZ3WltECCQ/RF9EtmHP3DE08=", "strip_prefix": "", "remote_patches": {}, "remote_patch_strip": 0 @@ -2628,35 +2712,6 @@ } } }, - "stardoc@0.5.6": { - "name": "stardoc", - "version": "0.5.6", - "key": "stardoc@0.5.6", - "repoName": "stardoc", - "executionPlatformsToRegister": [], - "toolchainsToRegister": [], - "extensionUsages": [], - "deps": { - "bazel_skylib": "bazel_skylib@1.5.0", - "rules_java": "rules_java@7.4.0", - "rules_license": "rules_license@0.0.8", - "bazel_tools": "bazel_tools@_", - "local_config_platform": "local_config_platform@_" - }, - "repoSpec": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "urls": [ - "/~https://github.com/bazelbuild/stardoc/releases/download/0.5.6/stardoc-0.5.6.tar.gz" - ], - "integrity": "sha256-37w2Sq7BQ99ebFL68fEWZ3WltECCQ/RF9EtmHP3DE08=", - "strip_prefix": "", - "remote_patches": {}, - "remote_patch_strip": 0 - } - } - }, "apple_support@1.13.0": { "name": "apple_support", "version": "1.13.0", @@ -4258,7 +4313,10 @@ "bzlFile": "@@apple_rules_lint~//lint/private:register_linters.bzl", "ruleClassName": "register_linters", "attributes": { - "linters": {} + "linters": { + "java-spotbugs": "'@@//java:spotbugs-config'", + "rust-rustfmt": "'@@//rust:enable-rustfmt'" + } } } }, diff --git a/WORKSPACE.bzlmod b/WORKSPACE.bzlmod index cd708dfde1aca..f2ade27426fca 100644 --- a/WORKSPACE.bzlmod +++ b/WORKSPACE.bzlmod @@ -4,25 +4,6 @@ workspace( load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -http_archive( - name = "apple_rules_lint", - sha256 = "7c3cc45a95e3ef6fbc484a4234789a027e11519f454df63cbb963ac499f103f9", - strip_prefix = "apple_rules_lint-0.3.2", - url = "/~https://github.com/apple/apple_rules_lint/archive/refs/tags/0.3.2.tar.gz", -) - -load("@apple_rules_lint//lint:repositories.bzl", "lint_deps") - -lint_deps() - -load("@apple_rules_lint//lint:setup.bzl", "lint_setup") - -# Add your linters here. -lint_setup({ - "java-spotbugs": "//java:spotbugs-config", - "rust-rustfmt": "//rust:enable-rustfmt", -}) - http_archive( name = "bazel_skylib", sha256 = "66ffd9315665bfaafc96b52278f57c7e2dd09f5ede279ea6d39b2be471e7e3aa",