I was going thru the docs and have a question rega...
# general
a
I was going thru the docs and have a question regarding Options. According to this page, there are 3 ways to set options: via command line, via an env var, and thru the config file. As per my understanding, the docs for a goal are structured in such a manner that the config file entry for an option is presented first followed by the command line argument and the env var for that option, in that order. I was looking at
generate-lockfiles
goal and can see from examples that the config file entry
resolve
can be used as a command line argument (see attached screenshot). Ideally the example should have been
pants generate-lockfiles --generate-lockfiles-resolve="['black','pytest','data-science']"
instead of
pants generate-lockfiles --resolve=black --resolve=pytest --resolve=data-science
. I say this because
resolve
is a config entry and either that should have gone in the
pants.toml
file or if we want to use command line,
--generate-lockfiles-resolve="['<str>', '<str>', ...]"
should have been used instead of
--resolve
.
e
If an option is preceeded by its owning goal or subsyetm name on the cli, you can abbreivate exactly as correctly shown in the help. So either
pants generate-lockfiles --generate-lockfiles-resolve=x
, or, less redundantly,
pants generate-lockfiles --resolve=x
- both should work.
This is discussed here in the second half: https://www.pantsbuild.org/docs/goals#goal-options
👍 1
a
Is there a way to contribute towards improving the documentation without setting up the full developer setup for Pants repo? Not this part in particular but wherever I feel the need.
e
If you use GitHub search in the repo I'm sure you can find the text you want to edit in a markdown file in the repo. Then you can click buttons and use the web editor to send a PR.
👍 1
Right, but for options, the doc is in the code; not a markdown doc. You should be able to use the same strategy though, you just won't get a rendered preview in that case without a dev setup of some sort.
👍 1