
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Black plugin for the Python LSP Server.
In the same virtualenv
as python-lsp-server
:
pip install python-lsp-black
This plugin will disable the yapf and autopep8 plugins if installed.
python-lsp-black
can either format an entire file or just the selected text.python-lsp-black
will use your project's
pyproject.toml if it has one.python-lsp-black
only officially supports the latest stable version of
black. An effort is made to keep backwards-compatibility
but older black versions will not be actively tested.cache_config
option, see Configuration below.The plugin follows python-lsp-server's configuration. These are the valid configuration keys:
pylsp.plugins.black.enabled
: boolean to enable/disable the plugin.pylsp.plugins.black.cache_config
: a boolean to enable black configuration caching (see
Usage). false
by default.pylsp.plugins.black.line_length
: an integer that maps to black's
max-line-length
setting. Defaults to 88 (same as black's default). This can also be set through black's
configuration files, which should be preferred for multi-user projects.pylsp.plugins.black.preview
: a boolean to enable or disable black's --preview
setting. false
by default.pylsp.plugins.black.skip_string_normalization
: a boolean to enable or disable black's --skip-string-normalization
setting. false
by default.pylsp.plugins.black.skip_magic_trailing_comma
: a boolean to enable or disable black's skip-magic-trailing-comma
setting. false
by default.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:
pre-commit install
To run tests:
make test
To run linters:
make lint # just a shortcut to pre-commit run -a
make <linter_name> # 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
FAQs
Black plugin for the Python LSP Server
We found that python-lsp-black demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.