Files
mongo/BUILD.bazel
Zack Winter c47bf8d1ef SERVER-100116 Set up rules_lint with eslint (#32036)
GitOrigin-RevId: b358136eaef9eec27470065d6254112867b56245
2025-04-09 19:38:20 +00:00

167 lines
3.5 KiB
Python

load("@npm//:defs.bzl", "npm_link_all_packages")
load("//bazel/install_rules:install_rules.bzl", "mongo_install")
load("//bazel/toolchains:mongo_toolchain.bzl", "setup_mongo_toolchain_aliases")
load("//bazel/config:render_template.bzl", "render_template")
load("@npm//:eslint/package_json.bzl", eslint_bin = "bin")
load("@aspect_rules_js//js:defs.bzl", "js_library")
package(
default_visibility = ["//visibility:public"],
)
exports_files([
"pyproject.toml",
"poetry.lock",
"symbols.orderfile",
"codeowners-validator",
])
npm_link_all_packages(name = "node_modules")
js_library(
name = "eslintrc",
srcs = ["eslint.config.mjs"],
deps = [
":node_modules/@eslint/js",
":node_modules/globals",
"//:node_modules/@eslint/eslintrc",
],
)
eslint_bin.eslint_binary(
name = "eslint",
data = [
"//:eslintrc",
],
)
alias(
name = "format",
actual = "//bazel/format",
)
alias(
name = "lint",
actual = "//bazel:lint",
)
alias(
name = "codeowners",
actual = "//buildscripts:codeowners",
)
setup_mongo_toolchain_aliases()
render_template(
name = "clang_tidy_config",
srcs = [
".clang-tidy.in",
"//buildscripts:clang_tidy_config_gen.py",
],
cmd = [
"$(location //buildscripts:clang_tidy_config_gen.py)",
"--input=$(location .clang-tidy.in)",
"--output=$(location .clang-tidy)",
],
output = ".clang-tidy",
)
render_template(
name = "clang_tidy_config_strict",
srcs = [
".clang-tidy.in",
"//buildscripts:clang_tidy_config_gen.py",
],
cmd = [
"$(location //buildscripts:clang_tidy_config_gen.py)",
"--input=$(location .clang-tidy.in)",
"--output=$(location .clang-tidy.strict)",
"--warnings-as-errors",
],
output = ".clang-tidy.strict",
)
genrule(
name = "compiledb",
srcs = ["compile_commands.json"],
outs = ["compile_commands_done"],
cmd = "echo noop > $(location :compile_commands_done)",
)
mongo_install(
name = "wiredtiger",
srcs = [
"//src/third_party/wiredtiger:wt",
],
)
mongo_install(
name = "mongod",
srcs = [
"//src/mongo/db:mongod",
],
)
mongo_install(
name = "mongos",
srcs = [
"//src/mongo/s:mongos",
],
)
mongo_install(
name = "mongo",
srcs = [
"//src/mongo/shell:mongo",
],
)
mongo_install(
name = "core",
srcs = [],
deps = [
"mongod",
"mongos",
],
)
mongo_install(
name = "devcore",
srcs = [],
deps = [
"mongo",
"mongod",
"mongos",
],
)
mongo_install(
name = "mongotest",
srcs = [
"//src/mongo/db/query/query_tester:mongotest",
],
)
mongo_install(
name = "dist-test",
srcs = [
"//src/mongo/db:mongod",
"//src/mongo/db:mongotrafficreader",
"//src/mongo/db/query/optimizer:optimizer_gdb_test_program",
"//src/mongo/db/query/query_tester:mongotest",
"//src/mongo/db/query/search/mongotmock",
"//src/mongo/db/storage/key_string:ksdecode",
"//src/mongo/s:mongos",
"//src/mongo/shell:mongo",
"//src/mongo/tools/mongobridge_tool:mongobridge",
"//src/mongo/util:pretty_printer_test_program",
"//src/third_party/wiredtiger:wt",
] + select({
"@platforms//os:windows": ["@windows_sasl//:bins"],
"//conditions:default": [],
}),
deps = [
"//src/mongo/db/modules/enterprise:dist-test",
],
)