<#19356 Add an `unmatched_build_file_globs` field ...
# github-notifications
c
#19356 Add an `unmatched_build_file_globs` field for targets that take a `sources` field Issue created by ndellosa95 Is your feature request related to a problem? Please describe. There's currently no way to specify optional targets or globs for targets. For example, if you have a
resources
targets that takes
*.yaml
and
*.yml
files, pants will warn if you don't have any files that use
*.yml
, even if the other glob is satisfied. Related issue here. Describe the solution you'd like Adding the field to the target would be one, but @happy-kitchen-89482 suggested using
~
as a syntax character, e.g.
sources=["~*.yaml", "~*.yml"]
which would tell pants to ignore lack of matches at the per-source level. It might also be worth considering adding a character for things that should explicitly error on a lack of a match. The behaviors defined by these characters should override the default
unmatched_build_file_globs
option. Describe alternatives you've considered Just disabling warnings for
unmatched_build_file_globs
globally is an option, but it's not a desirable option. Additional context No additional context at the moment. pantsbuild/pants