From 6797791c7e241a33248258cb71edc8ac877e62e7 Mon Sep 17 00:00:00 2001 From: Andres Monge Date: Fri, 13 Sep 2024 09:15:16 +0200 Subject: [PATCH 1/2] doc(ussage): Including a null-ls use with neovim. --- docs/notes_for_users.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/docs/notes_for_users.md b/docs/notes_for_users.md index bffe2e4..10b778c 100644 --- a/docs/notes_for_users.md +++ b/docs/notes_for_users.md @@ -187,3 +187,33 @@ somewhere in your repo. For more details, please check out [this section](https://jsh9.github.io/pydoclint/config_options.html#12---baseline). + +## 7. Integrating 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 From 65c232e5f9f6b7ab48da6907017a4ea61edf72b7 Mon Sep 17 00:00:00 2001 From: jsh9 <25124332+jsh9@users.noreply.github.com> Date: Mon, 23 Sep 2024 03:57:26 -0400 Subject: [PATCH 2/2] Move new content down one level --- docs/notes_for_users.md | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/docs/notes_for_users.md b/docs/notes_for_users.md index 10b778c..ec64706 100644 --- a/docs/notes_for_users.md +++ b/docs/notes_for_users.md @@ -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) @@ -188,9 +190,16 @@ somewhere in your repo. For more details, please check out [this section](https://jsh9.github.io/pydoclint/config_options.html#12---baseline). -## 7. Integrating pydoclint with Neovim using null-ls +## 7. How to integrate _pydoclint_ with different editors or IDEs -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: +### 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") @@ -202,7 +211,9 @@ null_ls.setup({ }) ``` -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: +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") @@ -216,4 +227,7 @@ null_ls.setup({ }) ``` -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 +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.