Hey pants! How do I ensure that every file within ...
# general
r
Hey pants! How do I ensure that every file within a _source_root,_ is always owned by a target in corresponding BUILD file
1
g
I think it's usually done with wildcards:
sources="*.py"
h
Manually, at the moment, alas.
Do you have a single high-level BUILD file per source root, or lots of little BUILD files down the tree under that source root, say one per code-containing directory?
r
@happy-kitchen-89482 the later, one build file per code-containing directory
its not just python file, which we can do by adding
*.py
python_sources on root
I want pants to fail if any file within
src/*
is not owned by any pants target
h
Doesn’t running
pants tailor
ensure that? Or do you mean literally any file, including those with suffixes pants knows nothing about?
r
all files with any suffix
I know that
pants tailor
takes care of *.py files
h
And what kind of target should some foo.bar file be assigned to?
files
or something? if it doesn’t match some other target type that is?
r
Yes, I think they can be
files
@happy-kitchen-89482 quick reminder on this 🙏
h
I think you’d have to write a plugin to make tailor do what you want here? I can’t think of a way to do this in vanilla pants
1