Install & Compatibility
Where this runs
tested against v0.6 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 28.3MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 3.8s · import 0.000s · 29MB
27MB installed
● package 27MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
pylint_flask
✓ pylint --load-plugins pylint_flask your_module.py
✗ from pylint_flask import ...
pylint-flask is loaded as a Pylint plugin via the command line, not imported directly into Python code.
Install `pylint-flask` and then run Pylint, explicitly loading the plugin with the `--load-plugins` flag. This example shows a minimal Flask app and how to lint it. For Flask extensions, ensure you are using direct imports (e.g., `from flask_wtf import ...`) as the `flask.ext` pattern is deprecated in modern Flask versions.
# my_flask_app.py
from flask import Flask
from flask_wtf import CSRFProtect # Example: direct import for Flask-WTF
app = Flask(__name__)
app.config['SECRET_KEY'] = 'a-very-secret-key'
csrf = CSRFProtect(app)
@app.route('/')
def index():
return 'Hello, Flask!'
# To run pylint with the plugin:
# pylint --load-plugins pylint_flask my_flask_app.py
Debug
Known issues
breakingThe `flask.ext` import pattern, which `pylint-flask` was primarily designed to address, was officially deprecated and removed in Flask 2.0. If you are using Flask 2.0 or newer, you should be using direct imports for extensions (e.g., `from flask_wtf import ...`). `pylint-flask`'s core functionality for `flask.ext` may be less relevant or even cause unexpected linting behavior with modern Flask applications.fixFor new projects or updated Flask versions (2.0+), migrate to direct imports for all Flask extensions (e.g., `from flask_sqlalchemy import SQLAlchemy` instead of `from flask.ext import sqlalchemy`). If you maintain older code, `pylint-flask` can still be beneficial, but be aware of the `flask.ext` deprecation.
affects: <= Flask 1.x (primary target of plugin), >= Flask 2.0 (impact on relevance)
gotchaWhile `pylint-flask` helps with generic Flask patterns, it may not fully resolve `E1101: no-member` errors for specific Flask extensions like Flask-SQLAlchemy or Flask-Migrate where attributes are dynamically added to objects. You might still encounter false positives for `db.Column`, `db.Integer`, etc.fixFor Flask-SQLAlchemy specific `no-member` issues, consider using `pylint-flask-sqlalchemy` in addition to `pylint-flask`. Otherwise, you may need to disable specific `no-member` checks globally, locally, or add `--generated-members` to your Pylint configuration.
affects: All versions of pylint-flask and related Flask extensions
gotchaPylint might report `W0611: Unused import <module_name>` even when an import is indirectly used, for example, by a decorator or if `pylint-flask` transforms an import, but the original reference isn't explicitly used elsewhere in the file.fixIf you are certain the import is necessary (e.g., for a decorator to register a route), you can explicitly tell Pylint to ignore the warning for that line using `# pylint: disable=unused-import` or configure Pylint to ignore this check for specific patterns.
affects: All versions
Upgrade
Version history
0.6latest on PyPI · released Jan 30, 2019
Audit
Dependencies
pylintrequiredpylint-flask is a plugin for Pylint and requires it to function.
Flaskrequiredpylint-flask is designed to analyze Flask applications.