Files
codeql/javascript/BUILD.bazel
Paolo Tranquilli 9f5782b67b Bazel: introduce buildifier formatting
This introduces tooling and enforcement for formatting bazel files.

The tooling is provided as a bazel run target from
[keith/buildifier-prebuilt](https://github.com/keith/buildifier-prebuilt).

This is used in a [`pre-commit`](https://pre-commit.com/) hook for those
having that installed. In turn this is used in a CI check. Relying on a
`pre-commit` action gives us easy checking that buildifying did not
change anything in the files and printing the diff, without having to
hand-roll the check ourselves.

This enforcement will make usage of gazelle easier, as gazelle itself
might reformat files, even outside of `go`. Having them properly
formatted will allow gazelle to leave them unchanged, without needing
to configure awkward exclude directives.
2024-04-24 15:49:48 +02:00

49 lines
1.2 KiB
Python

load("@rules_pkg//pkg:mappings.bzl", "pkg_files")
load("@semmle_code//:dist.bzl", "dist")
load("@semmle_code//buildutils-internal:zipmerge.bzl", "zipmerge")
package(default_visibility = ["//visibility:public"])
alias(
name = "dbscheme",
actual = "//javascript/ql/lib:dbscheme",
)
alias(
name = "dbscheme-stats",
actual = "//javascript/ql/lib:dbscheme-stats",
)
pkg_files(
name = "dbscheme-group",
srcs = [
":dbscheme",
":dbscheme-stats",
],
strip_prefix = None,
)
dist(
name = "javascript-extractor-pack",
srcs = [
":dbscheme-group",
"//javascript/downgrades",
"//javascript/externs",
"//javascript/extractor:tools-extractor",
"@semmle_code//language-packs/javascript:resources",
],
prefix = "javascript",
)
# We have to zipmerge in the typescript parser wrapper, as it's generated by a genrule
# and we don't know a list of its output files. Therefore, we sidestep the
# rules_pkg tooling here, and generate the zip for the language pack manually.
zipmerge(
name = "javascript",
srcs = [
":javascript-extractor-pack.zip",
"//javascript/extractor/lib/typescript",
],
out = "javascript.zip",
)