Skip to content
Draft
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
6 changes: 6 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,9 @@ coverage --combined_report=lcov
coverage --test_env=COVERAGE_GCOV_OPTIONS=-bcu
coverage --features=coverage
coverage --cache_test_results=no

# Clang-tidy: bazel test --config=clang-tidy //...
test:clang-tidy --aspects=//tools/lint:linters.bzl%clang_tidy_aspect
test:clang-tidy --output_groups=+rules_lint_report
test:clang-tidy --extra_toolchains=@llvm_toolchain//:cc-toolchain-x86_64-linux
test:clang-tidy --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_x86_64_unknown_linux_gnu
21 changes: 21 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# *******************************************************************************
# Copyright (c) 2025 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************

# Clang-tidy configuration for score_logging.
Checks: >
-*, clang-analyzer-*, cert-*, cppcoreguidelines-*, bugprone-*, misc-*, performance-*, readability-*, modernize-* #magic___^_^___line
WarningsAsErrors: >
clang-analyzer-*, #magic___^_^___line
HeaderFilterRegex: '^(?!.*/third_party/).*'

FormatStyle: file
31 changes: 31 additions & 0 deletions .github/workflows/clang_tidy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# *******************************************************************************
# Copyright (c) 2025 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************

name: Clang-Tidy

on:
pull_request:
types: [opened, reopened, synchronize]
merge_group:

jobs:
clang-tidy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Bazel
uses: bazel-contrib/setup-bazel@0.15.0
with:
bazelisk-version: 1.26.0
- name: Run clang-tidy
run: bazel test --config=clang-tidy --lockfile_mode=error //score/mw/...
1 change: 1 addition & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ use_format_targets()

exports_files([
"MODULE.bazel",
".clang-tidy",
])

# Creates all documentation targets:
Expand Down
20 changes: 20 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "rules_rust", version = "0.61.0")
bazel_dep(name = "rules_cc", version = "0.1.1")
bazel_dep(name = "aspect_rules_lint", version = "1.0.3")

bazel_dep(name = "score_cpp_policies", version = "0.0.0", dev_dependency = True)
git_override(
module_name = "score_cpp_policies",
commit = "87b5b33dea15ff2e2dde1b0aae9cb982f49bc277",
remote = "https://github.com/RSingh1511/score_cpp_policies.git",
)

bazel_dep(name = "toolchains_llvm", version = "1.5.0", dev_dependency = True)

bazel_dep(name = "buildifier_prebuilt", version = "7.3.1")
bazel_dep(name = "platforms", version = "1.0.0")

Expand Down Expand Up @@ -80,6 +90,16 @@ use_repo(
"score_qcc_x86_64_toolchain",
)

llvm = use_extension(
"@toolchains_llvm//toolchain/extensions:llvm.bzl",
"llvm",
dev_dependency = True,
)
llvm.toolchain(
llvm_version = "19.1.7",
)
use_repo(llvm, "llvm_toolchain")

PYTHON_VERSION = "3.12"

python = use_extension("@rules_python//python/extensions:python.bzl", "python", dev_dependency = True)
Expand Down
Loading
Loading