https://github.com/pgjones/flake8-flask
Flake8 plugin that checks Flask code against opinionated style rules
https://github.com/pgjones/flake8-flask
Last synced: about 1 year ago
JSON representation
Flake8 plugin that checks Flask code against opinionated style rules
- Host: GitHub
- URL: https://github.com/pgjones/flake8-flask
- Owner: pgjones
- License: mit
- Created: 2016-08-10T21:52:46.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-08-12T18:26:38.000Z (almost 10 years ago)
- Last Synced: 2025-02-16T19:33:31.900Z (over 1 year ago)
- Language: Python
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Flake8-Flask

Flake8-Flask is a [flake8](http://flake8.readthedocs.org/en/latest/)
plugin that checks flask against some opinionated styles. Notably
checking for trailing slashes in routes, that routes do not have
multiple methods and that blueprint prefixes match a specified form.
## Warnings
This package adds 3 new flake8 warnings
- `F440`: Route is Missing Trailing Slash.
- `F441`: Route has more than 1 method.
- `F450`: Blueprint prefix does not match /v\d+.
## Limitations
Any decorator added in the format
```python
@app.route(path, methods=[])
```
is considered a route regardless of the name or type of app. The path
and methods are then checked.
Any call in the format
```python
app.register_blueprint(blueprint, url_prefix=prefix)
```
is considered a blueprint registration regardless of the name or type
of app. The prefix is then checked.