Skip to content

Commit 0789777

Browse files
jose-elias-alvarezgithub-actions[bot]
authored andcommittedJul 4, 2023
chore: autogen metadata and docs
1 parent 740571d commit 0789777

File tree

3 files changed

+49
-1
lines changed

3 files changed

+49
-1
lines changed
 

‎doc/BUILTINS.md

+45
Original file line numberDiff line numberDiff line change
@@ -2603,6 +2603,51 @@ local sources = { null_ls.builtins.formatting.black }
26032603
- Command: `black`
26042604
- Args: `{ "--stdin-filename", "$FILENAME", "--quiet", "-" }`
26052605

2606+
### [blackd](https://github.com/psf/black)
2607+
2608+
blackd is a small HTTP server that exposes Black’s functionality over a simple protocol. The main benefit of using it is to avoid the cost of starting up a new Black process every time you want to blacken a file. The only way to configure the formatter is by using the provided config options, it will not pick up on config files.
2609+
2610+
#### Usage
2611+
2612+
```lua
2613+
local sources = { null_ls.builtins.formatting.blackd }
2614+
```
2615+
2616+
#### Defaults
2617+
2618+
- Filetypes: `{ "python" }`
2619+
- Method: `formatting`
2620+
2621+
#### Config
2622+
2623+
##### `hostname` (string)
2624+
2625+
Address to bind the server to. Defaults to localhost.
2626+
##### `port` (string)
2627+
2628+
Port to listen on. Defaults to 45484.
2629+
##### `line_length` (number)
2630+
2631+
Set how many characters per line to allow. Defaults to 88.
2632+
##### `skip_source_first_line` (boolean)
2633+
2634+
If set to true, the first line of the source code will be ignored. Defaults to false.
2635+
##### `skip_string_normalization` (boolean)
2636+
2637+
If set to true, no string normalization will be performed. Defaults to false.
2638+
##### `skip_magic_trailing_comma` (boolean)
2639+
2640+
If set to true, trailing commas will not be used as a reason to split lines. Defaults to false.
2641+
##### `preview` (boolean)
2642+
2643+
If set to true, experimental and potentially disruptive style changes will be used. Defaults to false.
2644+
##### `fast` (boolean)
2645+
2646+
If set to true, Black will not perform an AST safety check after formatting. Defaults to false.
2647+
##### `python_variant` (string)
2648+
2649+
If set to pyi, Black will format all input files like typing stubs regardless of the file extension. Otherwise, its value must correspond to a Python version or a set of comma-separated Python versions, optionally prefixed with py. (e.g. py3.5,py3.6). Defaults to empty string.
2650+
26062651
### [blade_formatter](https://github.com/shufo/blade-formatter)
26072652

26082653
An opinionated blade template formatter for Laravel that respects readability

‎lua/null-ls/builtins/_meta/filetype_map.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ return {
322322
python = {
323323
code_actions = { "refactoring" },
324324
diagnostics = { "flake8", "mypy", "pycodestyle", "pydocstyle", "pylama", "pylint", "pyproject_flake8", "ruff", "semgrep", "vulture" },
325-
formatting = { "autoflake", "autopep8", "black", "blue", "isort", "pyflyby", "pyink", "reorder_python_imports", "ruff", "usort", "yapf" }
325+
formatting = { "autoflake", "autopep8", "black", "blackd", "blue", "isort", "pyflyby", "pyink", "reorder_python_imports", "ruff", "usort", "yapf" }
326326
},
327327
qml = {
328328
diagnostics = { "qmllint" },

‎lua/null-ls/builtins/_meta/formatting.lua

+3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ return {
2828
black = {
2929
filetypes = { "python" }
3030
},
31+
blackd = {
32+
filetypes = { "python" }
33+
},
3134
blade_formatter = {
3235
filetypes = { "blade" }
3336
},

0 commit comments

Comments
 (0)
Please sign in to comment.