Black: Vim plugin should respect pyproject.toml config

Created on 21 Jul 2018  路  3Comments  路  Source: psf/black

vim-black does not respect configuration in pyproject.toml
Python version: 3.6
Black version: 18.3-alpha.0

pyproject.toml:

[tool.black]
line-length = 120
skip-string-normalization = true

From vim :Black will format the file using the default configuration or the global config in vimrc such as let g:black_skip_string_normalization = 1
It would be great if the vim plugin could use the project specific configuration

enhancement help wanted

Most helpful comment

Personally I would think the project-specific config would trump everything. Since it would be nice be able to override the global defaults in your vim config. But if a project has a specific config, I don't see when you would not want to use it.

All 3 comments

Absolutely agree. Happy to merge pull requests. What I'd like to see for it is:

  • if your Vim config does specify an option for any of this, use that over any project-specific pyproject.toml;
  • if your Vim config uses Black defaults, then consider project-specific pyproject.toml.

Personally I would think the project-specific config would trump everything. Since it would be nice be able to override the global defaults in your vim config. But if a project has a specific config, I don't see when you would not want to use it.

I guess you're right. Let's do it like this then.

Was this page helpful?
0 / 5 - 0 ratings