Files
carbon-lang/migrate_cpp/BUILD
T
Jon Ross-Perkins 605763d62d Add lint fixes to the buildifier setup. (#3109)
The main motivation for this is to get python loads in using the
`native-py` lint fix. However, enabling that made me wonder, maybe we
should fix in general?

`native-cc` is delayed, but not wholly cancelled (and `native-py`
picking up might indicate `native-cc` won't be too far behind). There's
also some automated fixes for `.append` and dict sorting -- this felt
okay to me, maybe not something to eagerly add but probably not worth
stopping buildifier from fixing (I've noticed the warnings in the past
and had been ignoring them).

Running everything does mean that load orders are sorted automatically
now, which I think is a positive. Most generally, I think these fixes
aren't _harmful_, and having them done automatically seems beneficial:
my biggest concern about `native-py` and `native-cc` was actually that
regressions wouldn't be caught, but this addresses that issue
automatically.
2023-08-22 21:01:42 +00:00

60 lines
1.5 KiB
Python

# 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
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
load("@rules_python//python:defs.bzl", "py_binary")
py_binary(
name = "migrate_cpp",
srcs = ["migrate_cpp.py"],
data = [
":clang_tidy.yaml",
"//migrate_cpp/cpp_refactoring",
],
python_version = "PY3",
)
cc_library(
name = "output_segment",
hdrs = ["output_segment.h"],
deps = [
"//common:check",
"@llvm-project//clang:ast",
],
)
cc_library(
name = "rewriter",
srcs = ["rewriter.cpp"],
hdrs = ["rewriter.h"],
visibility = [
# For dependency checking. Remove once it has a binary using it.
"//bazel/check_deps:__pkg__",
],
deps = [
":output_segment",
"//common:check",
"@llvm-project//clang:ast",
"@llvm-project//clang:basic",
"@llvm-project//clang:frontend",
"@llvm-project//clang:lex",
"@llvm-project//clang:tooling",
"@llvm-project//clang:tooling_core",
"@llvm-project//llvm:Support",
],
)
cc_test(
name = "rewriter_test",
srcs = ["rewriter_test.cpp"],
deps = [
":rewriter",
"//testing/base:gtest_main",
"@com_google_googletest//:gtest",
"@llvm-project//clang:ast",
"@llvm-project//clang:frontend",
"@llvm-project//clang:tooling",
],
)