A Pylint plugin for improving code analysis when editing code using Flask-SQLAlchemy
Project description
pylint_flask_sqlalchemy
Beware: this is still a WIP.
About
pylint_flask_sqlalchemy is Pylint plugin for improving code analysis when editing code using Flask-SQLAlchemy.
Usage
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 User(db.Model):
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(80), unique=True, nullable=False)
def __repr__(self):
return "<User %r>" % self.username
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:15: E1101: Instance of 'SQLAlchemy' has no 'Column' member (no-member)
app.py:12:25: E1101: Instance of 'SQLAlchemy' has no 'String' member (no-member)
----------------------------------------------------------------------
Your code has been rated at -10.00/10 (previous run: 10.00/10, -20.00)
😓
With pylint_flask_sqlalchemy: pylint --load-plugins pylint_flask_sqlalchemy app.py
----------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: -10.00/10, +20.00)
🥳
Installation
pip install pylint_flask_sqlalchemy
and tell pylint to --load-plugins pylint_flask_sqlalchemy
when you launch it.
Changelog
Current version
Changes
- Update readme.
0.0.2 (2019-07-13)
New
- First draft of the plugin.
Fixes
- Packaging.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for pylint_flask_sqlalchemy-0.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f486ef606def97e31a0ae5fc799c758d020072e6f84d3dcd80e6ef855847185d |
|
MD5 | bc6ff8a8c533079ae7535e4f0c7caf0e |
|
BLAKE2b-256 | 6f2b7f92a2e1fefb0079de85edc8fee4aaaca7f28a561c2341d8a1d72e6e9fae |
Close
Hashes for pylint_flask_sqlalchemy-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 073586c4e6073e0e6f0136a6020b391b75ba2ea7141ddd7b1f0a5a035b17b0c5 |
|
MD5 | 11fe4fa8093b3677ddf427f01b1d95a6 |
|
BLAKE2b-256 | 82b689ed82171f4af494da4f57957a4b14751291abc2f4a92c7d2f7b0a457677 |