Skip to main content

🐍 Python Extra

Linting for Python, on top of the pyright language server that comes with the core.

Enabling​

Included in the 42 extra. To enable it on its own, select lang.python in :FtVimExtras or add:

{ import = "ftvim.plugins.extras.lang.python" },

Features​

  • flake8 for style (PEP 8)
  • mypy for types

Both are installed with Mason and run when you open or save a file and when you leave insert mode. Errors show up as diagnostics.

With the 42 extra, mypy runs with the strict flags used in the Python piscine: --disallow-untyped-defs, --check-untyped-defs, --warn-return-any and --warn-unused-ignores.

The statusline shows the active virtualenv or conda environment.