Misc: add bazel buildifer pre-commit hook

This commit is contained in:
Alex Denisov 2023-06-30 13:05:40 +02:00
Родитель 4e4c5f858e
Коммит d744b218f6
6 изменённых файлов: 61 добавлений и 31 удалений

Просмотреть файл

@ -21,6 +21,11 @@ repos:
- id: autopep8
files: ^misc/codegen/.*\.py
- repo: https://github.com/warchant/pre-commit-buildifier
rev: 0.0.2
hooks:
- id: buildifier
- repo: local
hooks:
- id: codeql-format

Просмотреть файл

@ -4,8 +4,8 @@ load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
def codeql_workspace_deps(repository_name = "codeql"):
pip_install(
name = "codegen_deps",
requirements = "@%s//misc/codegen:requirements.txt" % repository_name,
name = "codegen_deps",
requirements = "@%s//misc/codegen:requirements.txt" % repository_name,
)
bazel_skylib_workspace()
rules_pkg_dependencies()

Просмотреть файл

@ -2,14 +2,14 @@ load("@bazel_skylib//rules:native_binary.bzl", "native_binary")
native_binary(
name = "codegen",
out = "codegen",
src = "//misc/codegen",
data = [
"//swift:schema",
"//swift:codegen_conf",
],
out = "codegen",
args = [
"--configuration-file=$(location //swift:codegen_conf)",
],
data = [
"//swift:codegen_conf",
"//swift:schema",
],
visibility = ["//swift:__subpackages__"],
)

30
swift/third_party/BUILD.binlog.bazel поставляемый
Просмотреть файл

@ -1,19 +1,27 @@
cc_library(
name = "binlog",
hdrs = glob(["include/**/*.hpp"]),
srcs = glob(["include/**/*.cpp"]),
includes = ["include"],
visibility = ["//visibility:public"],
name = "binlog",
srcs = glob(["include/**/*.cpp"]),
hdrs = glob(["include/**/*.hpp"]),
includes = ["include"],
visibility = ["//visibility:public"],
)
cc_binary(
name = "bread",
srcs = ["bin/bread.cpp", "bin/printers.hpp", "bin/printers.cpp", "bin/getopt.hpp"],
deps = [":binlog"],
name = "bread",
srcs = [
"bin/bread.cpp",
"bin/getopt.hpp",
"bin/printers.cpp",
"bin/printers.hpp",
],
deps = [":binlog"],
)
cc_binary(
name = "brecovery",
srcs = ["bin/brecovery.cpp", "bin/getopt.hpp"],
deps = [":binlog"],
name = "brecovery",
srcs = [
"bin/brecovery.cpp",
"bin/getopt.hpp",
],
deps = [":binlog"],
)

Просмотреть файл

@ -2,8 +2,19 @@ load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix")
cc_library(
name = "swift-llvm-support",
srcs = glob(["*.a", "*.so", "*.dylib"]),
hdrs = glob(["include/**/*", "stdlib/**/*" ]),
srcs = glob([
"*.a",
"*.so",
"*.dylib",
]),
hdrs = glob([
"include/**/*",
"stdlib/**/*",
]),
includes = [
"include",
"stdlib/public/SwiftShims",
],
linkopts = [
"-lm",
"-lz",
@ -19,7 +30,6 @@ cc_library(
],
"//conditions:default": [],
}),
includes = ["include", "stdlib/public/SwiftShims"],
visibility = ["//visibility:public"],
)

Просмотреть файл

@ -1,21 +1,28 @@
[
py_test(
name = test_dir + '-test',
name = test_dir + "-test",
size = "small",
srcs = ['autobuild_tester.py'],
main = 'autobuild_tester.py',
srcs = ["autobuild_tester.py"],
args = [
"$(location //swift/xcode-autobuilder)",
"$(location %s)" % test_dir,
],
data = [
"//swift/xcode-autobuilder",
test_dir,
] + glob([test_dir + '/**/*']),
args = [
'$(location //swift/xcode-autobuilder)',
'$(location %s)' % test_dir,
]
] + glob([test_dir + "/**/*"]),
main = "autobuild_tester.py",
)
for test_dir in glob(
["*"],
exclude = [
"*.*",
".*",
],
exclude_directories = 0,
)
for test_dir in glob(["*"], exclude_directories=0, exclude=['*.*', '.*'])
]
test_suite(
name='tests'
name = "tests",
)