mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Misc: add bazel buildifer pre-commit hook
This commit is contained in:
@@ -21,6 +21,11 @@ repos:
|
|||||||
- id: autopep8
|
- id: autopep8
|
||||||
files: ^misc/codegen/.*\.py
|
files: ^misc/codegen/.*\.py
|
||||||
|
|
||||||
|
- repo: https://github.com/warchant/pre-commit-buildifier
|
||||||
|
rev: 0.0.2
|
||||||
|
hooks:
|
||||||
|
- id: buildifier
|
||||||
|
|
||||||
- repo: local
|
- repo: local
|
||||||
hooks:
|
hooks:
|
||||||
- id: codeql-format
|
- id: codeql-format
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
|
|||||||
|
|
||||||
def codeql_workspace_deps(repository_name = "codeql"):
|
def codeql_workspace_deps(repository_name = "codeql"):
|
||||||
pip_install(
|
pip_install(
|
||||||
name = "codegen_deps",
|
name = "codegen_deps",
|
||||||
requirements = "@%s//misc/codegen:requirements.txt" % repository_name,
|
requirements = "@%s//misc/codegen:requirements.txt" % repository_name,
|
||||||
)
|
)
|
||||||
bazel_skylib_workspace()
|
bazel_skylib_workspace()
|
||||||
rules_pkg_dependencies()
|
rules_pkg_dependencies()
|
||||||
|
|||||||
@@ -2,14 +2,14 @@ load("@bazel_skylib//rules:native_binary.bzl", "native_binary")
|
|||||||
|
|
||||||
native_binary(
|
native_binary(
|
||||||
name = "codegen",
|
name = "codegen",
|
||||||
out = "codegen",
|
|
||||||
src = "//misc/codegen",
|
src = "//misc/codegen",
|
||||||
data = [
|
out = "codegen",
|
||||||
"//swift:schema",
|
|
||||||
"//swift:codegen_conf",
|
|
||||||
],
|
|
||||||
args = [
|
args = [
|
||||||
"--configuration-file=$(location //swift:codegen_conf)",
|
"--configuration-file=$(location //swift:codegen_conf)",
|
||||||
],
|
],
|
||||||
|
data = [
|
||||||
|
"//swift:codegen_conf",
|
||||||
|
"//swift:schema",
|
||||||
|
],
|
||||||
visibility = ["//swift:__subpackages__"],
|
visibility = ["//swift:__subpackages__"],
|
||||||
)
|
)
|
||||||
|
|||||||
30
swift/third_party/BUILD.binlog.bazel
vendored
30
swift/third_party/BUILD.binlog.bazel
vendored
@@ -1,19 +1,27 @@
|
|||||||
cc_library(
|
cc_library(
|
||||||
name = "binlog",
|
name = "binlog",
|
||||||
hdrs = glob(["include/**/*.hpp"]),
|
srcs = glob(["include/**/*.cpp"]),
|
||||||
srcs = glob(["include/**/*.cpp"]),
|
hdrs = glob(["include/**/*.hpp"]),
|
||||||
includes = ["include"],
|
includes = ["include"],
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
||||||
cc_binary(
|
cc_binary(
|
||||||
name = "bread",
|
name = "bread",
|
||||||
srcs = ["bin/bread.cpp", "bin/printers.hpp", "bin/printers.cpp", "bin/getopt.hpp"],
|
srcs = [
|
||||||
deps = [":binlog"],
|
"bin/bread.cpp",
|
||||||
|
"bin/getopt.hpp",
|
||||||
|
"bin/printers.cpp",
|
||||||
|
"bin/printers.hpp",
|
||||||
|
],
|
||||||
|
deps = [":binlog"],
|
||||||
)
|
)
|
||||||
|
|
||||||
cc_binary(
|
cc_binary(
|
||||||
name = "brecovery",
|
name = "brecovery",
|
||||||
srcs = ["bin/brecovery.cpp", "bin/getopt.hpp"],
|
srcs = [
|
||||||
deps = [":binlog"],
|
"bin/brecovery.cpp",
|
||||||
|
"bin/getopt.hpp",
|
||||||
|
],
|
||||||
|
deps = [":binlog"],
|
||||||
)
|
)
|
||||||
|
|||||||
16
swift/third_party/BUILD.swift-llvm-support.bazel
vendored
16
swift/third_party/BUILD.swift-llvm-support.bazel
vendored
@@ -2,8 +2,19 @@ load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix")
|
|||||||
|
|
||||||
cc_library(
|
cc_library(
|
||||||
name = "swift-llvm-support",
|
name = "swift-llvm-support",
|
||||||
srcs = glob(["*.a", "*.so", "*.dylib"]),
|
srcs = glob([
|
||||||
hdrs = glob(["include/**/*", "stdlib/**/*" ]),
|
"*.a",
|
||||||
|
"*.so",
|
||||||
|
"*.dylib",
|
||||||
|
]),
|
||||||
|
hdrs = glob([
|
||||||
|
"include/**/*",
|
||||||
|
"stdlib/**/*",
|
||||||
|
]),
|
||||||
|
includes = [
|
||||||
|
"include",
|
||||||
|
"stdlib/public/SwiftShims",
|
||||||
|
],
|
||||||
linkopts = [
|
linkopts = [
|
||||||
"-lm",
|
"-lm",
|
||||||
"-lz",
|
"-lz",
|
||||||
@@ -19,7 +30,6 @@ cc_library(
|
|||||||
],
|
],
|
||||||
"//conditions:default": [],
|
"//conditions:default": [],
|
||||||
}),
|
}),
|
||||||
includes = ["include", "stdlib/public/SwiftShims"],
|
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -1,21 +1,28 @@
|
|||||||
[
|
[
|
||||||
py_test(
|
py_test(
|
||||||
name = test_dir + '-test',
|
name = test_dir + "-test",
|
||||||
size = "small",
|
size = "small",
|
||||||
srcs = ['autobuild_tester.py'],
|
srcs = ["autobuild_tester.py"],
|
||||||
main = 'autobuild_tester.py',
|
args = [
|
||||||
|
"$(location //swift/xcode-autobuilder)",
|
||||||
|
"$(location %s)" % test_dir,
|
||||||
|
],
|
||||||
data = [
|
data = [
|
||||||
"//swift/xcode-autobuilder",
|
"//swift/xcode-autobuilder",
|
||||||
test_dir,
|
test_dir,
|
||||||
] + glob([test_dir + '/**/*']),
|
] + glob([test_dir + "/**/*"]),
|
||||||
args = [
|
main = "autobuild_tester.py",
|
||||||
'$(location //swift/xcode-autobuilder)',
|
)
|
||||||
'$(location %s)' % test_dir,
|
for test_dir in glob(
|
||||||
]
|
["*"],
|
||||||
|
exclude = [
|
||||||
|
"*.*",
|
||||||
|
".*",
|
||||||
|
],
|
||||||
|
exclude_directories = 0,
|
||||||
)
|
)
|
||||||
for test_dir in glob(["*"], exclude_directories=0, exclude=['*.*', '.*'])
|
|
||||||
]
|
]
|
||||||
|
|
||||||
test_suite(
|
test_suite(
|
||||||
name='tests'
|
name = "tests",
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user