Skip to content

Commit 1569ad4

Browse files
author
Jose Alvarez
authored
chore: add prettier config and format (#1076)
1 parent 1e59a77 commit 1569ad4

12 files changed

+109
-64
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

+22-7
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,19 @@ body:
77
attributes:
88
label: FAQ
99
options:
10-
- label: I have checked the [FAQ](https://github.com/jose-elias-alvarez/null-ls.nvim#faq) and it didn't resolve my problem.
10+
- label:
11+
I have checked the [FAQ](https://github.com/jose-elias-alvarez/null-ls.nvim#faq) and it didn't resolve my
12+
problem.
1113
required: true
1214

1315
- type: checkboxes
1416
id: issue-prerequisite
1517
attributes:
1618
label: Issues
1719
options:
18-
- label: I have checked [existing issues](https://github.com/jose-elias-alvarez/null-ls.nvim/issues?q=is%3Aissue) and there are no issues with the same problem.
20+
- label:
21+
I have checked [existing issues](https://github.com/jose-elias-alvarez/null-ls.nvim/issues?q=is%3Aissue) and
22+
there are no issues with the same problem.
1923
required: true
2024

2125
- type: input
@@ -35,14 +39,19 @@ body:
3539
- type: textarea
3640
attributes:
3741
label: "Minimal config"
38-
description: "Download the minimal config using `curl -fLO https://raw.githubusercontent.com/jose-elias-alvarez/null-ls.nvim/main/scripts/minimal_init.lua`. Edit it to include the configuration necessary to reproduce your bug and paste it here. Do not use your personal null-ls config!"
42+
description: "Download the minimal config using `curl -fLO
43+
https://raw.githubusercontent.com/jose-elias-alvarez/null-ls.nvim/main/scripts/minimal_init.lua`. Edit it to
44+
include the configuration necessary to reproduce your bug and paste it here. Do not use your personal null-ls
45+
config!"
3946
validations:
4047
required: true
4148

4249
- type: textarea
4350
attributes:
4451
label: "Steps to reproduce"
45-
description: "Full reproduction steps, starting with `nvim --clean -u minimal_init.lua`. Include a sample file if your issue relates to a specific filetype."
52+
description:
53+
"Full reproduction steps, starting with `nvim --clean -u minimal_init.lua`. Include a sample file if your issue
54+
relates to a specific filetype."
4655
validations:
4756
required: true
4857

@@ -63,7 +72,9 @@ body:
6372
- type: textarea
6473
attributes:
6574
label: "Debug log"
66-
description: "Debug log output from `:NullLsLog`, limited to the output from following your reproduction steps. Include this even if you think it's irrelevant."
75+
description:
76+
"Debug log output from `:NullLsLog`, limited to the output from following your reproduction steps. Include this
77+
even if you think it's irrelevant."
6778
validations:
6879
required: true
6980

@@ -82,7 +93,9 @@ body:
8293
- type: textarea
8394
attributes:
8495
label: "Implementation help"
85-
description: "If you selected yes in the last question please specify in detail what you would need help with in order to implement this."
96+
description:
97+
"If you selected yes in the last question please specify in detail what you would need help with in order to
98+
implement this."
8699
validations:
87100
required: false
88101

@@ -91,5 +104,7 @@ body:
91104
attributes:
92105
label: Requirements
93106
options:
94-
- label: I have read and followed the instructions above and understand that my issue will be closed if I did not provide the required information.
107+
- label:
108+
I have read and followed the instructions above and understand that my issue will be closed if I did not
109+
provide the required information.
95110
required: true

.github/ISSUE_TEMPLATE/feature_request.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ body:
77
attributes:
88
label: Issues
99
options:
10-
- label: I have checked [existing issues](https://github.com/jose-elias-alvarez/null-ls.nvim/issues) and there are no existing ones with the same request.
10+
- label:
11+
I have checked [existing issues](https://github.com/jose-elias-alvarez/null-ls.nvim/issues) and there are no
12+
existing ones with the same request.
1113
required: true
1214

1315
- type: textarea
@@ -31,6 +33,8 @@ body:
3133
- type: textarea
3234
attributes:
3335
label: "Implementation help"
34-
description: "If you selected yes in the last question please specify in detail what you would need help with in order to implement this."
36+
description:
37+
"If you selected yes in the last question please specify in detail what you would need help with in order to
38+
implement this."
3539
validations:
3640
required: false

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
doc/BUILTINS.md

.prettierrc

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"printWidth": 80,
3+
"proseWrap": "always",
4+
"overrides": [
5+
{
6+
"files": "*.yml",
7+
"options": {
8+
"printWidth": 120,
9+
"proseWrap": "preserve"
10+
}
11+
}
12+
]
13+
}

README.md

+18-10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<!-- markdownlint-configure-file
2+
{
3+
"line-length": false,
4+
"no-inline-html": false
5+
}
6+
-->
7+
18
# null-ls.nvim
29

310
Use Neovim as a language server to inject LSP diagnostics, code actions, and
@@ -190,8 +197,8 @@ plugin before sending anything upstream.
190197

191198
1. Make sure your configuration is in line with the latest version of this
192199
document.
193-
2. Enable debug mode (see below) and check the output of your source(s). If
194-
the CLI program is not properly configured or is otherwise not running as
200+
2. Enable debug mode (see below) and check the output of your source(s). If the
201+
CLI program is not properly configured or is otherwise not running as
195202
expected, that's an issue with the program, not null-ls.
196203
3. Check the documentation for available configuration options that might solve
197204
your issue.
@@ -213,17 +220,18 @@ instructions).
213220

214221
### How do I format files on save?
215222

216-
See [this wiki
217-
page](https://github.com/jose-elias-alvarez/null-ls.nvim/wiki/Formatting-on-save).
223+
See
224+
[this wiki page](https://github.com/jose-elias-alvarez/null-ls.nvim/wiki/Formatting-on-save).
218225

219226
### How do I stop Neovim from asking me which server I want to use for formatting?
220227

221-
See [this wiki page](https://github.com/jose-elias-alvarez/null-ls.nvim/wiki/Avoiding-LSP-formatting-conflicts).
228+
See
229+
[this wiki page](https://github.com/jose-elias-alvarez/null-ls.nvim/wiki/Avoiding-LSP-formatting-conflicts).
222230

223231
### How do I view project-level diagnostics?
224232

225-
For a built-in solution, use `:lua vim.diagnostic.setqflist()`. You can also
226-
use a plugin like [trouble.nvim](https://github.com/folke/trouble.nvim).
233+
For a built-in solution, use `:lua vim.diagnostic.setqflist()`. You can also use
234+
a plugin like [trouble.nvim](https://github.com/folke/trouble.nvim).
227235

228236
### How do I enable debug mode and get debug output?
229237

@@ -248,8 +256,7 @@ possible, so it should work seamlessly with most LSP-related plugins. If you run
248256
into problems, please try to determine which plugin is causing them and open an
249257
issue.
250258

251-
[This wiki
252-
page](https://github.com/jose-elias-alvarez/null-ls.nvim/wiki/Compatibility-with-other-plugins)
259+
[This wiki page](https://github.com/jose-elias-alvarez/null-ls.nvim/wiki/Compatibility-with-other-plugins)
253260
mentions plugins that require specific configuration options / tweaks to work
254261
with null-ls.
255262

@@ -302,7 +309,8 @@ All tests expect the latest Neovim master.
302309
- [formatter.nvim](https://github.com/mhartington/formatter.nvim): a Lua plugin
303310
that (surprise) focuses on formatting.
304311

305-
- [hover.nvim](https://github.com/lewis6991/hover.nvim): Hover plugin framework for Neovim.
312+
- [hover.nvim](https://github.com/lewis6991/hover.nvim): Hover plugin framework
313+
for Neovim.
306314

307315
## Sponsors
308316

doc/BUILTIN_CONFIG.md

+8-6
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ local sources = {
122122
}
123123
```
124124

125-
You can also override a source's arguments entirely using `with({ args = your_args })`.
125+
You can also override a source's arguments entirely using
126+
`with({ args = your_args })`.
126127

127128
Both `args` and `extra_args` can also be functions that accept a single
128129
argument, `params`, which is an object containing information about editor
@@ -175,8 +176,9 @@ local sources = {
175176

176177
### Filtering
177178

178-
You can filter generator results using the `filter` option. The option should
179-
be a function that returns `true` to keep the result, and `false` or `nil` to ignore it.
179+
You can filter generator results using the `filter` option. The option should be
180+
a function that returns `true` to keep the result, and `false` or `nil` to
181+
ignore it.
180182

181183
```lua
182184
local sources = {
@@ -309,9 +311,9 @@ local sources = {
309311
}
310312
```
311313

312-
For diagnostics sources, you should also update the source to [run on
313-
save](#diagnostics-on-save), since otherwise diagnostics will go out of sync
314-
with buffer changes.
314+
For diagnostics sources, you should also update the source to
315+
[run on save](#diagnostics-on-save), since otherwise diagnostics will go out of
316+
sync with buffer changes.
315317

316318
## Using local executables
317319

doc/CONFIG.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,9 @@ Plugin logs messages on several logging levels to following destinations:
148148

149149
### notify_format (string, optional)
150150

151-
Sets the default format for `vim.notify()` messages.
152-
Can be used to customize 3rd party notification plugins
153-
like [nvim-notify](https://github.com/rcarriga/nvim-notify).
151+
Sets the default format for `vim.notify()` messages. Can be used to customize
152+
3rd party notification plugins like
153+
[nvim-notify](https://github.com/rcarriga/nvim-notify).
154154

155155
### on_attach (function, optional)
156156

@@ -217,7 +217,8 @@ to `true` if you don't experience performance issues with your sources.
217217

218218
Note that by default, Neovim will not display updated diagnostics in insert
219219
mode. Together with the option above, you need to pass `update_in_insert = true`
220-
to `vim.diagnostic.config` for diagnostics to work as expected. See `:help vim.diagnostic.config` for more info.
220+
to `vim.diagnostic.config` for diagnostics to work as expected. See
221+
`:help vim.diagnostic.config` for more info.
221222

222223
## Explicitly defining the project root
223224

doc/CONTRIBUTING.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,11 @@ local diagnostic = {
104104
- Do not include the source's name or code in the message.
105105

106106
- If at all possible, please add one or more tests to check whether your source
107-
produces the correct output given an actual raw diagnostic. See [the
108-
existing tests](../test/spec/builtins/diagnostics_spec.lua) for examples.
107+
produces the correct output given an actual raw diagnostic. See
108+
[the existing tests](../test/spec/builtins/diagnostics_spec.lua) for examples.
109109

110-
- If your source can produce project-level diagnostics (i.e. diagnostics for more
111-
than one file at a time), use the `multiple_files` option described in
110+
- If your source can produce project-level diagnostics (i.e. diagnostics for
111+
more than one file at a time), use the `multiple_files` option described in
112112
[HELPERS](./HELPERS.md).
113113

114114
- Specify that your source supports project diagnostics in its documentation.

doc/HELPERS.md

+18-16
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ the first time.
5050

5151
### args
5252

53-
A table containing the arguments passed when spawning the command. Defaults to `{}`.
53+
A table containing the arguments passed when spawning the command. Defaults to
54+
`{}`.
5455

5556
null-ls will transform the following special arguments before spawning:
5657

@@ -70,11 +71,11 @@ null-ls will transform the following special arguments before spawning:
7071
Can either be a table of valid exit codes (numbers) or a callback that receives
7172
two arguments:
7273

73-
`code`: contains the exit code from the spawned command as a number
74-
`stderr`: error output from the job as a string
74+
`code`: contains the exit code from the spawned command as a number `stderr`:
75+
error output from the job as a string
7576

76-
The callback should return a boolean value indicating whether the code
77-
indicates _success_.
77+
The callback should return a boolean value indicating whether the code indicates
78+
_success_.
7879

7980
If not specified, null-ls will assume that a non-zero exit code indicates
8081
failure.
@@ -117,16 +118,16 @@ Supports the following options:
117118
- `"raw"`: passes command output directly as `params.output` (string) and error
118119
output as `params.err` (string).
119120

120-
This format will call `on_output(params, done)`, where `done()` is a callback that
121-
`on_output` must call with its results (see _Generators_ in
121+
This format will call `on_output(params, done)`, where `done()` is a callback
122+
that `on_output` must call with its results (see _Generators_ in
122123
[MAIN](MAIN.md) for details).
123124

124125
- `nil`: same as `raw`, but does not receive error output. Instead, any output
125126
to `stderr` will cause the generator to throw an error, unless `ignore_stderr`
126127
is also enabled (see below).
127128

128-
- `"line"`: splits generator output into lines and calls `on_output(line, params)`
129-
once for each line, where `line` is a string.
129+
- `"line"`: splits generator output into lines and calls
130+
`on_output(line, params)` once for each line, where `line` is a string.
130131

131132
- `"json"`: decodes generator output into JSON, sets `params.output` to the
132133
resulting JSON object, and calls `on_output(params)`. The wrapper will
@@ -140,11 +141,11 @@ To sum up:
140141

141142
- If you want to handle each line of a source's output, use `format = "line"`.
142143

143-
- If you are handling JSON output, use `format = "json"` if you don't intend on handling
144-
errors and `format = "json_raw"` if you do.
144+
- If you are handling JSON output, use `format = "json"` if you don't intend on
145+
handling errors and `format = "json_raw"` if you do.
145146

146-
- If you are processing a source's entire output, use `format = nil` if you don't
147-
intend on handling errors and `format = "raw"` if you do.
147+
- If you are processing a source's entire output, use `format = nil` if you
148+
don't intend on handling errors and `format = "raw"` if you do.
148149

149150
### from_stderr
150151

@@ -180,8 +181,8 @@ one file if this option is `true` and each diagnostic specifies a `bufnr` or
180181
### on_output
181182

182183
A callback function that receives a `params` object, which contains information
183-
about the current buffer and editor state (see _Generators_ in
184-
[MAIN](MAIN.md) for details).
184+
about the current buffer and editor state (see _Generators_ in [MAIN](MAIN.md)
185+
for details).
185186

186187
Generators created by `generator_factory` have access to an extra parameter,
187188
`params.output`, which contains the output from the spawned command. The
@@ -326,7 +327,8 @@ null_ls.helpers.range_formatting_args_factory(base_args, start_arg, end_rag, opt
326327
- `opts` (table?): a table containing the following options:
327328
- `opts.use_rows` (boolean?): specifies whether to use rows over character
328329
offsets.
329-
- `opts.use_length` (boolean?): used to specify the length of the range in `end_arg` instead of end the position.
330+
- `opts.use_length` (boolean?): used to specify the length of the range in
331+
`end_arg` instead of end the position.
330332
- `opts.row_offset` (number?): offset applied to row numbers.
331333
- `opts.col_offset` (number?): offset applied to column numbers.
332334
- `opts.delimiter` (string?): used to join range start and end into a single

doc/MAIN.md

+8-10
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ Splits into the following documents:
1111
- [MAIN](MAIN.md) (this document), which describes general concepts and
1212
implementation details
1313

14-
- [CONFIG](CONFIG.md), which describes the available configuration
15-
options
14+
- [CONFIG](CONFIG.md), which describes the available configuration options
1615

1716
- [BUILTINS](BUILTINS.md), an automatically generated list of available built-in
1817
sources
@@ -22,8 +21,8 @@ Splits into the following documents:
2221

2322
- [SOURCES](SOURCES.md), which describes the source API
2423

25-
- [HELPERS](HELPERS.md), which describes available helpers and how to use
26-
them to make new sources
24+
- [HELPERS](HELPERS.md), which describes available helpers and how to use them
25+
to make new sources
2726

2827
- [TESTING](TESTING.md), which describes best practices for testing null-ls
2928
integrations
@@ -80,8 +79,8 @@ my_source.method = null_ls.methods.COMPLETION
8079
### Filetypes
8180

8281
A source has a list of filetypes, which define when the source is active. The
83-
list can contain a single filetype, more than one filetype, or nothing,
84-
which indicates that the source should activate for all filetypes.
82+
list can contain a single filetype, more than one filetype, or nothing, which
83+
indicates that the source should activate for all filetypes.
8584

8685
```lua
8786
local my_source = {}
@@ -150,8 +149,8 @@ null_ls.register({ name = "my-sources", ... })
150149
null_ls.register({ name = "my-sources", ... })
151150
```
152151

153-
null-ls also exposes a method, `is_registered()`, that returns a
154-
boolean value indicating whether it has already registered a source.
152+
null-ls also exposes a method, `is_registered()`, that returns a boolean value
153+
indicating whether it has already registered a source.
155154

156155
```lua
157156
local null_ls = require("null-ls")
@@ -358,8 +357,7 @@ Same as formatting.
358357
Note that getting range-formatted output requires converting the visually
359358
selected range into the required format and modifying the spawn arguments
360359
accordingly. See `range_formatting_args_factory` in [HELPERS](HELPERS.md) for an
361-
example of how null-ls handles this for built-in
362-
sources.
360+
example of how null-ls handles this for built-in sources.
363361

364362
#### Hover
365363

doc/SOURCES.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ local query = {
8282
}
8383
```
8484

85-
All keys in the query are optional, and passing an empty query will get
86-
all sources.
85+
All keys in the query are optional, and passing an empty query will get all
86+
sources.
8787

8888
Note that special characters are automatically escaped when `query` is a string
8989
but not when it's an object, which allows using Lua string matchers.

0 commit comments

Comments
 (0)