X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/62bfbd6a63dcac2f6f31eb014f69397c9eb967d2..3800ebd81df6a1c31d1eac8cc15899537b9cbb61:/docs/guides/using_black_with_other_tools.md diff --git a/docs/guides/using_black_with_other_tools.md b/docs/guides/using_black_with_other_tools.md index 4b22f67..1d380bd 100644 --- a/docs/guides/using_black_with_other_tools.md +++ b/docs/guides/using_black_with_other_tools.md @@ -13,7 +13,7 @@ tools out there. tools, using **their** supported file formats. Compatible configuration files can be -[found here](https://github.com/psf/black/blob/master/docs/compatible_configs/). +[found here](https://github.com/psf/black/blob/main/docs/compatible_configs/). ### isort @@ -24,10 +24,10 @@ to conflicting changes. #### Profile Since version 5.0.0, isort supports -[profiles](https://pycqa.github.io/isort/docs/configuration/profiles/) to allow easy +[profiles](https://pycqa.github.io/isort/docs/configuration/profiles.html) to allow easy interoperability with common code styles. You can set the black profile in any of the -[config files](https://pycqa.github.io/isort/docs/configuration/config_files/) supported -by isort. Below, an example for `pyproject.toml`: +[config files](https://pycqa.github.io/isort/docs/configuration/config_files.html) +supported by isort. Below, an example for `pyproject.toml`: ```toml [tool.isort] @@ -97,7 +97,7 @@ does not break older versions so you can keep it if you are running previous ver
.isort.cfg -```cfg +```ini [settings] profile = black ``` @@ -107,7 +107,7 @@ profile = black
setup.cfg -```cfg +```ini [isort] profile = black ``` @@ -181,7 +181,7 @@ extend-ignore = E203
setup.cfg -```cfg +```ini [flake8] max-line-length = 88 extend-ignore = E203 @@ -210,31 +210,16 @@ mixed feelings about _Black_'s formatting style. #### Configuration ``` -disable = C0330, C0326 max-line-length = 88 ``` #### Why those options above? -When _Black_ is folding very long expressions, the closing brackets will -[be dedented](../the_black_code_style/current_style.md#how-black-wraps-lines). +Pylint should be configured to only complain about lines that surpass `88` characters +via `max-line-length = 88`. -```py3 -ImportantClass.important_method( - exc, limit, lookup_lines, capture_locals, callback -) -``` - -Although this style is PEP 8 compliant, Pylint will raise -`C0330: Wrong hanging indentation before block (add 4 spaces)` warnings. Since _Black_ -isn't configurable on this style, Pylint should be told to ignore these warnings via -`disable = C0330`. - -Also, since _Black_ deals with whitespace around operators and brackets, Pylint's -warning `C0326: Bad whitespace` should be disabled using `disable = C0326`. - -And as usual, Pylint should be configured to only complain about lines that surpass `88` -characters via `max-line-length = 88`. +If using `pylint<2.6.0`, also disable `C0326` and `C0330` as these are incompatible with +_Black_ formatting and have since been removed. #### Formats @@ -242,9 +227,6 @@ characters via `max-line-length = 88`. pylintrc ```ini -[MESSAGES CONTROL] -disable = C0330, C0326 - [format] max-line-length = 88 ``` @@ -257,9 +239,6 @@ max-line-length = 88 ```cfg [pylint] max-line-length = 88 - -[pylint.messages_control] -disable = C0330, C0326 ```
@@ -268,9 +247,6 @@ disable = C0330, C0326 pyproject.toml ```toml -[tool.pylint.messages_control] -disable = "C0330, C0326" - [tool.pylint.format] max-line-length = "88" ```