Black: Document mapping between command-line options and settings in pyproject.toml

Created on 30 Dec 2018  路  4Comments  路  Source: psf/black

It's not completely straight-forward how to specify black settings in the toml file. For example, its hard to figure out how to add the --skip-string-normalization option to pyproject.toml.

It would be really good if the documentation had the related pyproject setting documented for each option.

documentation

All 4 comments

Happy to review a PR

well I couldn't' figure it out so I don't have much to contribute, I'm afraid.

This works:

[tool.black]
skip-string-normalization = true

The mapping is algorithmic - handled here: https://github.com/psf/black/blob/1ab87a3f67bc80a2e59be2692f2e2f25dd143af7/black.py#L246-L248

The values are consumed downstream as these params:

https://github.com/psf/black/blob/1ab87a3f67bc80a2e59be2692f2e2f25dd143af7/black.py#L389-L405

The documentation includes a pyproject.toml example which includes dashed options as well. It does also say that "The option keys are the same as long names of options on the command line."

Was this page helpful?
0 / 5 - 0 ratings

Related issues

spapanik picture spapanik  路  23Comments

jonadaly picture jonadaly  路  23Comments

lig picture lig  路  84Comments

kindjacket picture kindjacket  路  21Comments

devxpy picture devxpy  路  70Comments