Skip to content

Commit

Permalink
doc(usage): Including a null-ls use with neovim. (#167)
Browse files Browse the repository at this point in the history
Co-authored-by: jsh9 <25124332+jsh9@users.noreply.github.com>
  • Loading branch information
aemonge and jsh9 authored Sep 23, 2024
1 parent 5e941f5 commit 27ff769
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions docs/notes_for_users.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
- [4. Notes on writing Sphinx-style docstrings](#4-notes-on-writing-sphinx-style-docstrings)
- [5. Notes for Google-style users](#5-notes-for-google-style-users)
- [6. How to adopt _pydoclint_ more easily in legacy projects](#6-how-to-adopt-pydoclint-more-easily-in-legacy-projects)
- [7. How to integrate _pydoclint_ with different editors or IDEs](#7-how-to-integrate-pydoclint-with-different-editors-or-ides)
- [7.1. Integrate _pydoclint_ with Neovim using null-ls](#71-integrate-pydoclint-with-neovim-using-null-ls)

<!--TOC-->

Expand Down Expand Up @@ -187,3 +189,45 @@ somewhere in your repo.

For more details, please check out
[this section](https://jsh9.github.io/pydoclint/config_options.html#12---baseline).

## 7. How to integrate _pydoclint_ with different editors or IDEs

### 7.1. Integrate _pydoclint_ with Neovim using null-ls

If you use [Neovim](https://neovim.io/), you can integrate _pydoclint_ with
your editor using the [null-ls](https://github.com/nvimtools/none-ls.nvim)
plugin. null-ls allows you to use linters and formatters in Neovim in a simple
and efficient way. First, make sure you have installed null-ls using your
preferred package manager. Next, add the following configuration to your Neovim
config file to register _pydoclint_ as a diagnostic source:

```lua
local null_ls = require("null-ls")

null_ls.setup({
sources = {
null_ls.builtins.diagnostics.pydoclint,
},
})
```

This will enable _pydoclint_ to provide diagnostic messages for your Python
code directly in Neovim. You can further customize the behavior of _pydoclint_
by passing additional options:

```lua
local null_ls = require("null-ls")

null_ls.setup({
sources = {
null_ls.builtins.diagnostics.pydoclint.with({
extra_args = {"--style=google", "--check-return-types=False"},
}),
},
})
```

Adjust the extra*args based on your preferred \_pydoclint* configuration. With
this setup, you can now enjoy the benefits of _pydoclint_'s fast and
comprehensive docstring linting directly within your Neovim editing
environment.

0 comments on commit 27ff769

Please sign in to comment.