You might wish to not execute DWYU on some specific targets.
An easy way to do so is tagging a target with dwyu:skip.
You can however also define a custom tag to mark targets which shall be skipped by the DWYU analysis.
Executing the following fails due to the target using a header without a proper dependency.
bazel build --config=dwyu //skipping_targets:bad_targetExecuting the following succeeds due to the target being tagged with dwyu:skip.
bazel build --config=dwyu //skipping_targets:bad_target_skippedExecuting the following showcases the same skipping behavior, but for the tag mmy_tag.
See the bazelrc file and aspect.bzl for the definition of the config and the aspect configuration.
bazel build --config=dwyu_custom_skipping //skipping_targets:bad_target_custom_skipExecuting the following showcases how we can ignore targets from external workspaces. See the bazelrc file and aspect.bzl for the definition of the config and the aspect configuration.
bazel build --config=dwyu_skip_external //skipping_targets:use_broken_external_dependency