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

fresh-cat-90827

08/31/2022, 3:41 PM
Do we expect an option value passed via the command line to be appended to the list of values specified in the
pants.toml
? 😕 I could be misunderstanding the docs.
Copy code
[coverage-py]
report = ["xml"]
./pants test --use-coverage --coverage-py-report=html ::
Gives me
Copy code
Wrote xml coverage report to `dist/coverage_results`
Wrote html coverage report to `dist/coverage_results`
b

bitter-ability-32190

08/31/2022, 3:41 PM
Yes! That's by-design I believe
f

fresh-cat-90827

08/31/2022, 3:41 PM
I expected the the html override what’s given in the
report
?
./pants test --use-coverage --coverage-py-report="['html']" ::
this overrides
👍 1
b

bitter-ability-32190

08/31/2022, 3:42 PM
Yeah that one
h

hundreds-father-404

08/31/2022, 3:43 PM
yeah, this is called "implicit add" and it's because string escaping on the CLI is obnoxious
f

fresh-cat-90827

08/31/2022, 3:44 PM
./pants test --use-coverage --coverage-py-report=html --coverage-py-report=json ::
gives me
Copy code
Wrote xml coverage report to `dist/coverage_results`
Wrote html coverage report to `dist/coverage_results`
Wrote json coverage report to `dist/coverage_results`
h

hundreds-father-404

08/31/2022, 3:45 PM
yeah, that's expected
f

fresh-cat-90827

08/31/2022, 3:47 PM
from the docs:
You can also leave off the
[]
to append elements. So we can rewrite the above to:
Copy code
./pants --scope-listopt=foo --scope-listopt=bar
I think what’s meant here is to append elements to any existing elements that may have been defined in lower-precedence sources ?
2
i.e. not to append to each other to form
[foo,bar]
but to do
[foo,bar,X]
where
X
is what may have been defined before
anyway, thanks for confirming!
h

hundreds-father-404

08/31/2022, 3:49 PM
ah yeah, feel free to submit a docs improvement 🙂
options.md
1
4 Views