pythonspyderpylintpyflakes

Disable linting in Spyder (orange triangles from Pyflakes)


I have an import that is only used in a doctest. The linter (Pyflakes) that is used by Spyder to generate warnings right next to the code doesn't like this. I tried a bunch of ways of turning off the "imported but unused" warning, but the orange triangle in the left margin doesn't go away.

Since these triangles do not stem from Pylint but from Pyflakes, options for pylint naturally don't work:

import pandas as pd # pylint: disable=unused-import
import pandas as pd # pylint: disable=W0611

How can I turn the warnings off? I installed Spyder via WinPython.


Solution

  • With the new Spyder version 5.3.3, the following methods are now available in order to suppress the orange warning triangles: Append either # noqa or # analysis:ignore to the end of the line in question.

    Suppressing only specific error types does not seem to work at this point in time.

    (This information is mostly based on the closing post of the GitHub issue which Ilya mentioned.)