hundreds-father-404
05/23/2022, 7:57 PMtailor
to the new, consistent CLI args semantics. Most cases are obvious:
• tailor ::
-> everything
• tailor dir::
-> everything in dir
and below
• tailor dir
-> everything in dir
The super tricky thing is how to handle a single file, ./pants tailor src/py/tests.py
. Do we think it's important that only adds a python_tests
target and not python_sources
if the dir was missing it? Or is it fine if it gets expanded to the whole directory?The super tricky thing is how to handle a single file, ./pants tailor src/py/tests.py. Do we think it's important that only adds a python_tests target and not python_sources if the dir was missing it?This is challenging to pull off! For example, what if you say to only run on
foo_test.py
and it turns out bar_test.py
is also missing a python_tests
target. Do we set sources=["foo_test.py"]
rather than using the default sources?
I think I could probably figure it out...but it is hard and will will likely require rewriting tailor
implementationsfast-nail-55400
05/23/2022, 8:00 PMhundreds-father-404
05/23/2022, 8:01 PM./pants --changed-since=HEAD tailor
will error, as it uses FileLiteralSpec
to work./pants --changed-since=HEAD tailorUsing this as a case study... • You create a new directory, for now w/ just one test file • I think most users would rather have
python_tests()
than python_tests(sources=["my_test.py"])
. It's more future-proof
Which suggests to me, we should replace a file literal w/ its directoryhigh-energy-55500
05/24/2022, 9:01 AMtailor
work with single files at all? if BUILD
files exist at the directory level, I don’t think it makes sense to run tailor
against files, only directorieshundreds-father-404
05/24/2022, 12:12 PM./pants --changed-since=HEAD tailor
should work -- and that requires individual files to work
But I ended up implementing this as a single file -> run against that file's whole directory. I'm pretty sure it's what makes sense, and 100x easier to implementhigh-energy-55500
05/24/2022, 4:18 PM