Home > Blockchain >  How do I load the flask-sqlalchemy plugin for flycheck (pylint) on Emacs?
How do I load the flask-sqlalchemy plugin for flycheck (pylint) on Emacs?

Time:02-17

If I'm running pylint from the command line, I'd load the pylint_flask_sqlalchemy plugin by running:

pylint --load-plugins pylint_flask_sqlalchemy app.py

If I were running VScode, I would add a few lines to settings.json.

But I'm running pylint through flycheck on Emacs. Everything is configured properly and runs fine, except that on

class Links(db.Model):
    __tablename__ = 'links'
    id = db.Column(db.Integer, autoincrement=True)

I get:

Instance of 'SQLAlchemy' has no 'Column' member [no-member]

How do I load the flask-sqlalchemy plugin for flycheck (pylint) on Emacs?

CodePudding user response:

You can specify options in flycheck-pylintrc("pylintrc" ".pylintrc" "pyproject.toml" "setup.cfg") in the workspace folder, which is located by the functions from flycheck-locate-config-file-functions.

Here is an example of pyproject.toml from Github.

CodePudding user response:

Just adding to Tianshu's answer (who otherwise nails it).

Whereas the package names use hyphens:

> pip freeze | grep pylint-flask
pylint-flask==0.6
pylint-flask-sqlalchemy==0.2.0

the plugin names use underscores

# List of plugins (as comma separated values of python module names) to load,
# usually to register additional checkers.
load-plugins=pylint_flask,pylint_flask_sqlalchemy

See here to get a .pylintrc started.

  • Related