
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
pylint-flask-sqlalchemy
Advanced tools
A Pylint plugin for improving code analysis when editing code using Flask-SQLAlchemy
pylint_flask_sqlalchemy is a Pylint plugin for improving code analysis with Flask-SQLAlchemy.
Using a simple flask app
"""app.py"""
# pylint: disable=missing-docstring,too-few-public-methods,invalid-name
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:////tmp/test.db"
db = SQLAlchemy(app)
class Group(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(80), unique=True, nullable=False)
def __repr__(self):
return "<User %r>" % self.username
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(80), unique=True, nullable=False)
group = db.relationship(Group)
def __repr__(self):
return "<User %r>" % self.username
user = User(username="test")
db.session.add(user)
db.session.commit()
Without the plugin: pylint app.py
app.py:11:9: E1101: Instance of 'SQLAlchemy' has no 'Column' member (no-member)
app.py:11:19: E1101: Instance of 'SQLAlchemy' has no 'Integer' member (no-member)
app.py:12:11: E1101: Instance of 'SQLAlchemy' has no 'Column' member (no-member)
app.py:12:21: E1101: Instance of 'SQLAlchemy' has no 'String' member (no-member)
app.py:19:9: E1101: Instance of 'SQLAlchemy' has no 'Column' member (no-member)
app.py:19:19: E1101: Instance of 'SQLAlchemy' has no 'Integer' member (no-member)
app.py:20:15: E1101: Instance of 'SQLAlchemy' has no 'Column' member (no-member)
app.py:20:25: E1101: Instance of 'SQLAlchemy' has no 'String' member (no-member)
app.py:21:12: E1101: Instance of 'SQLAlchemy' has no 'relationship' member (no-member)
app.py:28:0: E1101: Instance of 'scoped_session' has no 'add' member (no-member)
app.py:29:0: E1101: Instance of 'scoped_session' has no 'commit' member (no-member)
----------------------------------------------------------------------
Your code has been rated at -18.95/10 (previous run: 10.00/10, -28.95)
😓
With pylint_flask_sqlalchemy: pylint --load-plugins pylint_flask_sqlalchemy app.py
----------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: -13.08/10, +23.08)
🥳
pip install pylint_flask_sqlalchemy
and tell pylint to --load-plugins pylint_flask_sqlalchemy
when you launch it.
Handle scoped_session has no * member.
Handle scoped_session has no * member.
FAQs
A Pylint plugin for improving code analysis when editing code using Flask-SQLAlchemy
We found that pylint-flask-sqlalchemy demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.