LibCST/pyproject.toml
MapleCCC c75dbd482c
Fix black configuration (#769)
* Raise black's output file's target version to 3.7, which is the lowest supported Python version that libcst can be run on

* Add to, instead of override, the exclusion rules of black

* Fix the bug that files in `stubs/libcst_native/` are inadvertently ignored by black

This is due to black's file exclusion mechanism is a file-system-unaware pure-string-based pattern match. We need to prepend "^/" to specify that we are referring to the root-level "native/" folder. Yeah, I know this looks strange, but blame black for it :) . See https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#configuration-format for further reference.

* It's conventional to use single-quote literal string to represent regular expression in TOML format, because in this way it doesn't perform any escaping

* When codemod, specify the black formatter to use the same target Python version we use

* Fix the `test_codemod_formatter_error_input` unit test

* Remove an unused import in `test_codemod_cli` module
2022-09-14 15:22:45 +01:00

12 lines
397 B
TOML

[tool.black]
target-version = ["py37"]
extend-exclude = '^/native/' # Prepend "^/" to specify root file/folder. See https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#configuration-format
[tool.ufmt]
excludes = ["native/", "stubs/"]
[tool.slotscheck]
exclude-modules = '^libcst\.(testing|tests)'
[build-system]
requires = ["setuptools", "wheel", "setuptools-rust"]