|  | # Copyright 2024 The Pigweed Authors | 
|  | # | 
|  | # Licensed under the Apache License, Version 2.0 (the "License"); you may not | 
|  | # use this file except in compliance with the License. You may obtain a copy of | 
|  | # the License at | 
|  | # | 
|  | #     https://www.apache.org/licenses/LICENSE-2.0 | 
|  | # | 
|  | # Unless required by applicable law or agreed to in writing, software | 
|  | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | 
|  | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | 
|  | # License for the specific language governing permissions and limitations under | 
|  | # the License. | 
|  |  | 
|  | load("@bazel_skylib//rules:copy_file.bzl", "copy_file") | 
|  | load("@hedron_compile_commands//:refresh_compile_commands.bzl", "refresh_compile_commands") | 
|  | load("@pigweed//pw_build:compatibility.bzl", "incompatible_with_mcu") | 
|  | load("@rules_mypy//mypy:mypy.bzl", "mypy_cli") | 
|  |  | 
|  | package(default_visibility = ["//visibility:public"]) | 
|  |  | 
|  | copy_file( | 
|  | name = "copy_clangd", | 
|  | src = "@pigweed//pw_toolchain/host_clang:clangd", | 
|  | out = "clangd", | 
|  | allow_symlink = True, | 
|  | ) | 
|  |  | 
|  | refresh_compile_commands( | 
|  | name = "refresh_compile_commands", | 
|  | out_dir = ".compile_commands", | 
|  | tags = [ | 
|  | "nomypy", | 
|  | "nopylint", | 
|  | ], | 
|  | target_compatible_with = incompatible_with_mcu(), | 
|  | target_groups = { | 
|  | "host_simulator": [ | 
|  | "//apps/blinky:simulator_blinky", | 
|  | "//modules/blinky:blinky_test", | 
|  | ], | 
|  | "rp2040": [ | 
|  | "//apps/blinky:rp2040_blinky.elf", | 
|  | [ | 
|  | "//modules/blinky:blinky_test", | 
|  | "--config=rp2040", | 
|  | ], | 
|  | ], | 
|  | }, | 
|  | ) | 
|  |  | 
|  | filegroup( | 
|  | name = "pw_console_config", | 
|  | srcs = [ | 
|  | ".pw_console.yaml", | 
|  | ], | 
|  | ) | 
|  |  | 
|  | filegroup( | 
|  | name = "clang_tidy_config", | 
|  | srcs = [".clang-tidy"], | 
|  | ) | 
|  |  | 
|  | filegroup( | 
|  | name = "pylintrc", | 
|  | srcs = [".pylintrc"], | 
|  | ) | 
|  |  | 
|  | filegroup( | 
|  | name = "mypy_ini", | 
|  | srcs = ["mypy.ini"], | 
|  | ) | 
|  |  | 
|  | mypy_cli( | 
|  | name = "mypy_cli", | 
|  | # We don't want to lint the mypy_runner.py in rules_mypy with Pigweed's | 
|  | # pylint configuration. | 
|  | tags = ["nopylint"], | 
|  | ) |