eager-dress-66405
10/07/2021, 6:45 PMBUILD.pants
for all of our build files. Renaming existing ones was easy, but I noticed ./pants tailor
was still creating BUILD
files even with build_patterns = ["BUILD.pants"]
(i think this option doesn't actually change anything, but was trying to be explicit). I went looking at the code and found the ability to change this was recently added in https://github.com/pantsbuild/pants/pull/12979. I'm currently running 2.7.0
, am I correct that this option won't be usable until 2.8.0
? I tried 2.8.0.dev0
and it still isn't available. And I assume I don't want to be using the beta..hundreds-father-404
10/07/2021, 6:47 PM./pants tailor
, then downgrade to 2.7build_patterns
does do something: it teaches Pants what your BUILD file names are when reading them. Whereas the new ./pants tailor
option is what to use when generating themeager-dress-66405
10/07/2021, 6:48 PM[tailor]\nbuild_file_name = "BUILD.pants"
. I thought not changing the toml and using ./pants tailor --build-file-name BUILD.pants
would work, but did not for some reasontailor] build_file_name
) that [GLOBAL] build_patterns
might magically apply to tailor, making it explicit seems fine to me. However even for reading BUILD
files build_patterns = ["BUILD.pants"]
seems unnecessary because by default it will look for any BUILD.{suffix}
anyway.witty-crayon-22786
10/07/2021, 6:55 PMI thought not changing the toml and usingthat should work… all options should be able to be specified in any of env, config, cli. odd.would work, but did not for some reason./pants tailor --build-file-name BUILD.pants
hundreds-father-404
10/07/2021, 6:59 PM./pants tailor --build-file-name=BUILD.pants
with an =
, yikeswitty-crayon-22786
10/07/2021, 7:00 PMhundreds-father-404
10/07/2021, 7:00 PMHowever even for reading BUILD files build_patterns = ["BUILD.pants"] seems unnecessary because by default it will look for any BUILD.{suffix} anyway.Yeah, not necessary. But would make it explicit and avoid the risk of users accidentally checking in
BUILD
while I was hopeful (before I found tailor] build_file_name ) that [GLOBAL] build_patterns might magically apply to tailor,FYI we couldn't do that because it's not clear how to map a pattern like
BUILD.*
with a glob into the file name to useeager-dress-66405
10/07/2021, 7:16 PMhundreds-father-404
10/07/2021, 7:19 PMeager-dress-66405
10/07/2021, 7:47 PMhundreds-father-404
10/07/2021, 7:58 PM./pants
and the pre-commit
hooks. Compiling Rust is really really slow the first time, unfortunately. Because this change is fairly simple, it's fine to not test locally and let CI do that for you
Two FYIs with getting the help
string to play nicely with terminal sizes, btw:
1. We use implicit string concatenation, like this, because it lets the terminal resize rather than forcing newlines at certain widths
help=(
"hello world this is "
"a single sentence"
)
1. We use \n\n
to start a new "paragraph". Makes it easier to scan docs. What you're adding doesn't relate to what's already there, so should probably be a new paragraph