Metadata-Version: 2.1
Name: pylint-flask-sqlalchemy
Version: 0.2.0
Summary: A Pylint plugin for improving code analysis when editing code using Flask-SQLAlchemy
Home-page: https://gitlab.anybox.cloud/rboyer/pylint_flask_sqlalchemy
Author: Anybox
Author-email: rboyer@anybox.fr
Maintainer: Renaud Boyer
Maintainer-email: rboyer@anybox.fr
License: GPL
Project-URL: Bug Tracker, https://gitlab.anybox.cloud/rboyer/pylint_flask_sqlalchemy/issues
Project-URL: Documentation, https://gitlab.anybox.cloud/rboyer/pylint_flask_sqlalchemy
Project-URL: Source Code, https://gitlab.anybox.cloud/rboyer/pylint_flask_sqlalchemy
Description: # pylint_flask_sqlalchemy
        
        ## About
        
        pylint_flask_sqlalchemy is a [Pylint](https://www.pylint.org/) plugin for improving code
        analysis with [Flask-SQLAlchemy](https://flask-sqlalchemy.palletsprojects.com).
        
        ## Usage
        
        Using a simple flask app
        
        ```python
        """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`
        
        ```sh
        ----------------------------------------------------------------------
        Your code has been rated at 10.00/10 (previous run: -13.08/10, +23.08)
        ```
        
        🥳
        
        ## Installation 
        
        ```
        pip install pylint_flask_sqlalchemy
        ```
        
        and tell pylint to `--load-plugins pylint_flask_sqlalchemy` when you launch it. 
        
        
        # Changelog
        
        ## Current version
        
        ### New
        
        * Handle scoped_session has no * member.
        
        
        ## 0.1.0 (2019-07-18)
        
        ### New
        
        * Handle scoped_session has no * member.
        
        * Handle scoped_session has no * member.
        
        ### Changes
        
        * Udpate readme.
        
        
        ## 0.0.3 (2019-07-13)
        
        ### Changes
        
        * Update readme.
        
        
        ## 0.0.2 (2019-07-13)
        
        ### New
        
        * First draft of the plugin.
        
        ### Fixes
        
        * Packaging.
        
        
        
Platform: any
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: License :: OSI Approved :: GNU General Public License (GPL)
Classifier: Typing :: Typed
Requires-Python: >=3.5
Description-Content-Type: text/markdown
Provides-Extra: dev
