[Tutor] What editor tools (plugins/extensions) would you consider essential for efficient Python development?

boB Stepp robertvstepp at gmail.com
Mon Nov 11 19:53:46 EST 2019


I thought I would follow up on my questions in case anyone is waiting
with bated breath ~(:>))  The intent of my original post was primarily
query about programming tools that it would be good for me to
implement regardless of my specific editor and then to narrow it down
to the best specific plugins for my actual editor.  Judging from the
lack of responses... <shrug>  Anyway here is what my best efforts came
up with...

On Fri, Nov 8, 2019 at 9:54 PM boB Stepp <robertvstepp at gmail.com> wrote:
>
> What Neovim plugins would any of you recommend as especially useful?
> Searching online I have found a variety of opinions, but as to
> functionality I have seen suggested:
>     1)  Git integration plugins.
>     2)  Code completion plugins.
>     3)  Linters.
>     4)  File explorer plugins.
>     5)  Bracket and quote completion plugins.
>     6)  Comments plugins.
>     7)  Code autoformatting plugins.
>     8)  PEP 8 compatibility plugins.
>     9)  Multiple cursor plugins.
>   10)  Code folding plugins.
>   11)  "Fuzzy" searching plugins.
>   12)  And on and on and ...

After research I feel that the following plugin functionalities would
improve my code quality and coding efficiency:  1) Enhanced syntax
highlighting; 2) Code completion; 3) Code linting, especially checking
for PEP 8 and 257 compatibility; 4) Code autoformatting; 5)
Implementing type annotation and its checking.  As best as I can tell
from my research these are the functionalities that can make a
meaningful difference in my code quality and coding efficiency.  The
other categories of tools in my mind fall into the category of "nice
to haves" or "aesthetically pleasing".

As to specific plugins for my chosen editor, Neovim:

1)  I am trying out Semshi (https://github.com/numirias/semshi).  The
built-in syntax highlighting of Neovim seems to be fairly good, but
Semshi seems to offer enhancement.  My only thought is whether things
will become too busy looking.

2)  Code completion:  I really struggled on this one.  There are a
variety of options.  I finally went with Conquer of Completion
(https://github.com/neoclide/coc.nvim), which is designed to take
advantage of Neovim's asynchronous plugin running capabilities.  I had
trouble figuring out its configuration.  Apparently it can use Jedi or
Microsoft Language Services for its language syntax knowledge.  I
chose the former and had to install that via pip.

3)  Code linting:  This was another toughy.  I finally went with ALE
(= Asynchronous Lint Engine) (https://github.com/dense-analysis/ale),
again designed upfront to take advantage of Neovim's asynchronous
capabilities.  Apparently ALE can run in the background, or, upon
save, quite a large variety of linters and code formatters.  For
Python it supports autopep8, bandit, black, flake8, isort, mypy,
prospector, pycodestyle, pydocstyle, pyflakes, pylama, pylint, pyls,
pyre, reorder-python-imports, vulture and yapf.  Of course all of
these have to be installed for ALE to find them.  Of these options I
am going to try to run the flake8 package (Pyflakes, pycodestyle,
Mccabe) as I edit, pylint upon save, black on save, mypy as I edit,
pydocstyle as I type.

4)  Code autoformatting:  Black.

5)  Type annotation checking:  Study up on it and use MyPy.

I am not entirely sure if I yet have everything configured correctly,
but "stuff" is happening.  Especially with ALE I am not certain yet
whether everything that is supposed to be happening, is, in fact,
happening.  But interesting gutter markings are showing up in my
buffers and when I go one of these lines a message appears in my
editor's status bar.  We'll see.  As always, configuring these tools
and figuring out how to properly use them is a painful process for me.

Hopefully all of this will be helpful and not harmful.  However, I
notice that one of my source files that I copied and ran Black on made
one of the linters unhappy for about four lines where it did not like
the level of indentation chosen for a dictionary definition with some
long entries.  Also, is it considered bad style to define constants
(using all caps) locally in a function definition?  Did not like that
one either.

I might want to investigate some of the other tools that I currently
see more as conveniences, but that will have to wait until I figure
out what I have already installed.

Cheers!

-- 
boB


More information about the Tutor mailing list