File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 6
6
7
7
> [ Black] ( https://github.com/ambv/black ) plugin for the [ Python LSP Server] ( https://github.com/python-lsp/python-lsp-server ) .
8
8
9
+ ## Install
10
+
9
11
In the same ` virtualenv ` as ` python-lsp-server ` :
10
12
11
13
``` shell
12
14
pip install python-lsp-black
13
15
```
14
16
17
+ # Usage
18
+
15
19
To avoid unexpected results you should make sure ` yapf ` and ` autopep8 ` are not installed.
16
20
17
21
* ` python-lsp-black ` can either format an entire file or just the selected text.
18
22
* The code will only be formatted if it is syntactically valid Python.
19
23
* Text selections are treated as if they were a separate Python file.
20
24
Unfortunately this means you can't format an indented block of code.
21
25
* ` python-lsp-black ` will use your project's [ pyproject.toml] ( https://github.com/ambv/black#pyprojecttoml ) if it has one.
26
+
27
+ # Development
28
+
29
+ To install the project for development you need to specify the dev optional dependencies:
30
+
31
+ ``` shell
32
+ python -m venv .venv
33
+ . .venv/bin/activate
34
+ pip install -e .[dev]
35
+ ```
36
+
37
+ To run tests:
38
+
39
+ ``` shell
40
+ make test
41
+ ```
42
+
43
+ To run linters (flake8, black, isort, mypy...)
44
+
45
+ ``` shell
46
+ make lint
47
+ ```
You can’t perform that action at this time.
0 commit comments