brash-baker-91190
02/02/2022, 5:57 PMcookiecutter
(a templating tool - https://cookiecutter.readthedocs.io/en/1.7.2/) project that creates a Pants project, and is itself a Pants project. Everything works great, but I want to have Pants ignore any BUILD
files within the body of the template itself (because those BUILD
files may themselves be templates, and thus not valid files for Pants to process as-is). I can do this with the following stanza in my top-level pants.toml
file:
build_ignore = [
# Don't want the BUILD files in the template to get treated as
# though they applied to this project.
"\\{\\{ cookiecutter.__repo_name \\}\\}"
]
(Yes, that directory name -- {{ cookiecutter.__repo_name }}
-- is a Jinja templating directive; that's just how cookiecutter
works.)
That complicated escaping is the best thing I've been able to come across that is accepted and lets me actually run Pants. However, when I run Pants with this configuration, I get a slew of repeated messages like this:
12:50:50.87 [WARN] <string>:1: DeprecationWarning: invalid escape sequence \{
The pants.toml
is the only place in the project that has this character sequence.
I'm not exactly sure what escape sequence would work here (again, nothing else I've thought of seems to be accepted). The DeprecationWarning
also makes me concerned that the next release of Pants will no longer work with this repository. Anybody else seen anything like this or have any suggestions? Thanks 🙇high-yak-85899
02/02/2022, 6:00 PMbrash-baker-91190
02/02/2022, 6:00 PMhigh-yak-85899
02/02/2022, 6:01 PMbrash-baker-91190
02/02/2022, 6:04 PMException: Could not parse glob exclude pattern `"{{ cookiecutter.__repo_name }}"`: Glob { glob: Some("{{ cookiecutter.__repo_name }}"), err: "nested alternate groups are not allowed" }
brash-baker-91190
02/02/2022, 6:07 PM'\\{\\{ cookiecutter.__repo_name \\}\\}'
works (i.e., change from double to single quotes, but keep all the escaping)brash-baker-91190
02/02/2022, 6:08 PMhigh-yak-85899
02/02/2022, 6:09 PMcurved-television-6568
02/02/2022, 6:27 PM[regex-lint]
config = "@build-support/regexes/config.yaml"
Perrhaps that would be a workable alternative.. ?brash-baker-91190
02/02/2022, 6:33 PMbrash-baker-91190
02/02/2022, 6:45 PMregex-lint
? I don't think I've encountered that; is it new?curved-television-6568
02/02/2022, 7:08 PMvalidate
goal, that’s moving into the lint
goal.
https://www.pantsbuild.org/docs/reference-validatebrash-baker-91190
02/02/2022, 7:13 PMhappy-kitchen-89482
02/02/2022, 10:36 PM.template
and the thing that stamps out the cookies strips that suffixbrash-baker-91190
02/02/2022, 10:47 PM