Skip to content
Merged
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
4 changes: 4 additions & 0 deletions .github/workflows/clangd_tidy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ jobs:
if: steps.filter.outputs.has_cpp == 'true'
run: ./scripts/create_compdb.py

- name: Build deps for clangd-tidy
if: steps.filter.outputs.has_cpp == 'true'
run: ./scripts/run_bazel.py build //scripts:deps_for_clangd_tidy

- name: Install clangd-tidy
if: steps.filter.outputs.has_cpp == 'true'
run: pip install clangd-tidy==1.1.0.post2
Expand Down
15 changes: 15 additions & 0 deletions scripts/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Exceptions. See /LICENSE for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

load("@rules_cc//cc:cc_library.bzl", "cc_library")
load("@rules_python//python:defs.bzl", "py_test")

py_test(
Expand All @@ -10,3 +11,17 @@ py_test(
srcs = ["no_op_test.py"],
main = "no_op_test.py",
)

cc_library(
name = "deps_for_clangd_tidy",
srcs = ["deps_for_clangd_tidy.cpp"],
deps = [
# `@boost_unordered` uses `strip_prefix`, which results in
# `_virtual_includes` being part of the `compile_commands.json`. To
# support tools like `clangd-tidy`, this is intended to generate that directory.
#
# For example:
# bazel-out/<mode>/bin/external/+_repo_rules+boost_unordered/_virtual_includes/boost_unordered
"@boost_unordered",
],
)
8 changes: 8 additions & 0 deletions scripts/deps_for_clangd_tidy.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

// This file is only validating expected includes exist. See the BUILD target
// for more information.

#include <boost/unordered/unordered_flat_map.hpp>
Loading