https://pantsbuild.org/ logo
#general
Title
# general
p

proud-appointment-36730

06/15/2022, 7:17 PM
Noticed some weird behavior with pants that I thought I would bring up. I have a messy monorepo, and after running
pants tailor
in the repo I ended up with a
BUILD
file in
.git/logs/refs/remotes/origin
. Contents of the
BUILD
file:
Copy code
python_sources()
We have sort of a complex branch naming scheme, so I'm wondering if
pants tailor
saw a file in that directory that it thought was a python file and thus dumped a
BUILD
file in that directory? I'm wondering how
pants tailor
works its magic under the hood ...
h

hundreds-father-404

06/15/2022, 7:25 PM
Hm,
.git
should be ignored by default. Are you able to share the
GLOBAL
section of your
pants.toml
?
p

proud-appointment-36730

06/15/2022, 7:42 PM
Copy code
[GLOBAL]
pants_version = "2.11.0"
pants_ignore = [
    "/infra/deployments",
    "/infra/postgres_maintenance",
    "/alembic",
]
backend_packages = [
    "pants.backend.python",
    "pants.backend.python.lint.black",
    "pants.backend.python.lint.isort",
    "pants.backend.docker",
    "pants.backend.docker.lint.hadolint",
]
h

hundreds-father-404

06/15/2022, 7:45 PM
Ah, use
pants_ignore.add
to preserve our default. Definitely a gotcha
🙏 1
h

happy-kitchen-89482

06/15/2022, 8:19 PM
Copy code
pants_ignore.add = [...]
to clarify
👍 2
2 Views