GitHub - python-lsp/python-lsp-black: python-lsp-server plugin that adds support to black autoformatter, forked from https://github.com/rupert/pyls-black/ (original) (raw)

python-lsp-black

PyPI Code style: black Python

Black plugin for the Python LSP Server.

Install

In the same virtualenv as python-lsp-server:

pip install python-lsp-black

Usage

This plugin will disable the yapf and autopep8 plugins if installed.

Configuration

The plugin follows python-lsp-server's configuration. These are the valid configuration keys:

Development

To install the project for development you need to specify the dev optional dependencies:

python -m venv .venv . .venv/bin/activate pip install -e .[dev]

This project uses pre-commit hooks to control code quality, install them to run automatically when creating a git commit, thus avoiding seeing errors when you create a pull request:

To run tests:

To run linters:

make lint # just a shortcut to pre-commit run -a make # black, flake8, isort, mypy

To upgrade the version of the pre-commit hooks:

pre-commit autoupdate

check and git commit changes to .pre-commit-config.yaml