Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/check_bazel_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,36 @@ env:
ZMQ_LIBRARY_PREFIX: /usr/lib/x86_64-linux-gnu
ZMQ_INCLUDE_PREFIX: /usr/include
jobs:
v2:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential curl
- uses: bazel-contrib/setup-bazel@0.19.0
with:
bazelisk-cache: true
- name: Build
run: bazel build --verbose_failures //...
working-directory: ./udf-runner-cpp/v2
- name: Install clang-tidy
run: |
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" -- 22
sudo apt-get install -y clang-tidy-22
- name: Run clang-tidy
run: bazel build --verbose_failures --config clang-tidy //...
working-directory: ./udf-runner-cpp/v2
- name: Install clang-format
run: sudo apt-get install -y clang-format
- name: Run clang-format
run: bazel build --verbose_failures --config clang-format //...
working-directory: ./udf-runner-cpp/v2
- name: Run tests
run: bazel test --verbose_failures //...
working-directory: ./udf-runner-cpp/v2

build:
runs-on: ubuntu-24.04
steps:
Expand Down
22 changes: 22 additions & 0 deletions udf-runner-cpp/v2/.bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# The clang-tidy and clang-format rule packages are published in this registry.
common --registry=https://raw.githubusercontent.com/digiboys/bazel-registry/main
common --registry=https://bcr.bazel.build

build:clang-tidy --@rules_clang_tidy//:config=//tools/clang-tidy:config
build:clang-tidy --@rules_clang_tidy//:clang-tidy=//tools/clang-tidy:wrapper
build:clang-tidy --aspects=@rules_clang_tidy//:aspects.bzl%check
build:clang-tidy --output_groups=report
build:clang-tidy --remote_download_outputs=toplevel
build:clang-tidy --keep_going
build:clang-tidy --build_tag_filters=-noclangtidy
build:clang-tidy --copt=-Wno-pragma-once-outside-header

build:clang-format --aspects=@bazel_clang_format//:defs.bzl%check_aspect
build:clang-format --output_groups=report
build:clang-format --@bazel_clang_format//:config=//tools/clang-format:clang-format-config
build:clang-format --build_tag_filters=-noclangtidy

build:clang-format-fix --aspects=@bazel_clang_format//:defs.bzl%fix_aspect
build:clang-format-fix --output_groups=report
build:clang-format-fix --use_action_cache=false
build:clang-format-fix --@bazel_clang_format//:config=//tools/clang-format:clang-format-config
3 changes: 3 additions & 0 deletions udf-runner-cpp/v2/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ cc_test(
alias(
name = "arrow_core",
actual = "@v2_arrow//:arrow_core",
# Arrow and its vendored sources are third-party code. Keep them out of
# the repository's clang-tidy and clang-format CI profiles.
tags = ["noclangtidy"],
)

filegroup(
Expand Down
12 changes: 12 additions & 0 deletions udf-runner-cpp/v2/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@ bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(name = "flatbuffers", version = "25.2.10")
bazel_dep(name = "google_benchmark", version = "1.9.5")

bazel_dep(
name = "rules_clang_tidy",
version = "0.0.0",
dev_dependency = True,
)

bazel_dep(
name = "bazel_clang_format",
version = "0.0.0",
dev_dependency = True,
)

# FlatBuffers currently selects versions of these transitive build tools that
# still use the removed incompatible_use_toolchain_transition rule attribute.
# Override them so the v2 module can be analyzed by Bazel 9.
Expand Down
81 changes: 81 additions & 0 deletions udf-runner-cpp/v2/tools/clang-format/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@


---
Language: Cpp
# BasedOnStyle: Google
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: false
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
ColumnLimit: 100
CommentPragmas: '^ IWYU pragma:'
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
IndentCaseLabels: true
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 3
NamespaceIndentation: Inner
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
ReflowComments: true
SortIncludes: false
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: true
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: c++20
TabWidth: 4
UseTab: Never
5 changes: 5 additions & 0 deletions udf-runner-cpp/v2/tools/clang-format/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
filegroup(
name = "clang-format-config",
srcs = [".clang-format"],
visibility = ["//visibility:public"],
)
Loading
Loading