How to highlight Python modules that are not used in Emacs

Something like 6 months ago, I met a developer who used Emacs. We wrote Django code and therefore Python. There is a function that he turned on (wrote himself?), Which can highlight imported modules that were not used.

I want to have this, unfortunately, I have not found anything related in the last 15 minutes. Therefore, I assume that he himself wrote. I am far from the Lisp guru you guys could be, so I am here, asking for directions on such a task;].

+4
source share
3 answers

For automatic verification using imported modules, you need to select the checkbox and python mode, and then run the flycheck-verify-setup command.

flycheck-verify-setup (all installed and based)

Later you should install python packages like pep8, pylint, flake8 and others. Install it using pip on the system side ( recommended ) or in your virtual environment.

Flycheck highlight unused imported module

+4
source

You can get automatic python syntax checking (including unused imports) by installing flycheck

+5
source

ropemacs can (among other things) organize imports (delete duplicate and unused imports, sort them, ...).

I'm not sure if unused imports are highlighted, but it definitely helps with that.

Also, since pyflakes detects unused imports, something like flymake-python-pyflakes might make some of the highlight (in addition to other goodies)

+2
source

Source: https://habr.com/ru/post/1495738/


All Articles