Skip to main content

flake8-flask

flake8-flask is a plugin for flake8 with checks specifically for the flask framework, written by r2c

Installation

pip install flake8-flask

Validate the install using --version.

> flake8 --version
3.7.9 (flake8-flask: 0.9.3, mccabe: 0.6.1, pycodestyle: 2.5.0, pyflakes: 2.1.1)

List of warnings

r2c-flask-send-file-open: This check detects the use of a file-like object in flask.send_file without either mimetype or attachment_filename keyword arguments. send_file will throw a ValueError in this situation.

r2c-flask-secure-set-cookie: This check detects calls to response.set_cookie that do not have secure, httponly, and samesite set. This follows the guidance in the Flask documentation.

r2c-flask-unescaped-file-extension: Flask will not autoescape Jinja templates that do not have .html, .htm, .xml, or .xhtml as extensions. This check will alert you if you do not have one of these extensions. This check will also do its best to detect if context variables are escaped if a non-escaped extension is used.

r2c-flask-use-blueprint-for-modularity: This check recommends using Blueprint when there are too many route handlers in a single file. Blueprint encourages modularity and can greatly simplify how large applications work and provide a central means for Flask extensions to register operations on applications.

r2c-flask-use-jsonify: flask.jsonify() is a Flask helper method which handles the correct settings for returning JSON from Flask routes. This check catches uses of json.dumps() returned from Flask routes and encourages flask.jsonify() instead.

r2c-flask-missing-jwt-token: This check alerts when @jwt_required, @jwt_optional, @fresh_jwt_required, and @jwt_refresh_token_required decorators are missing in files where flask_jwt, flask_jwt_extended, or flask_jwt_simple packages are imported.

Have an idea for a check? Reach out to us at https://r2c.dev!

Metadata

Release files for flake8-flask 0.9.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flake8-flask 0.9.3
File Size Uploaded Provenance
flake8-flask-0.9.3.tar.gz 10.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for flake8-flask 0.9.3
File Interpreter ABI Platform
flake8_flask-0.9.3-py3-none-any.whl Python 3 none any Details

Total release size: 25.2 kB

Release files / flake8-flask-0.9.3.tar.gz

Download URL flake8-flask-0.9.3.tar.gz
Size 10.5 kB
Tags Source
SHA-256 checksum
How to use checksums
8be2dfbad5fec26e83037c634d82966544480c0aa697fb8185d14c9918e1cc14
BLAKE2b-256 checksum
How to use checksums
e933982e6b326763bf67891a84ff51b0e9383edec7a8c23c33129da6472ea8b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.0 CPython/3.7.7 Darwin/19.4.0

Release files / flake8_flask-0.9.3-py3-none-any.whl

Download URL flake8_flask-0.9.3-py3-none-any.whl
Size 14.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1d4beb6ed69bc6f8a8f97a64ebeca681eee936fa2c8793d678aed5dad5aa054a
BLAKE2b-256 checksum
How to use checksums
7122598c5664e85797a049df8b4a1136e9a857b0086d9d9f731772e1acfce1ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.0 CPython/3.7.7 Darwin/19.4.0

Security for flake8-flask 0.9.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.9.3 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page