https://github.com/jschaf/pylint-flask
A Pylint plugin to analyze Flask applications.
https://github.com/jschaf/pylint-flask
Last synced: 3 months ago
JSON representation
A Pylint plugin to analyze Flask applications.
- Host: GitHub
- URL: https://github.com/jschaf/pylint-flask
- Owner: jschaf
- License: gpl-2.0
- Created: 2015-06-27T20:11:12.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2022-07-19T20:45:56.000Z (almost 4 years ago)
- Last Synced: 2025-10-21T20:48:13.979Z (7 months ago)
- Language: Python
- Homepage:
- Size: 28.3 KB
- Stars: 64
- Watchers: 2
- Forks: 8
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
pylint-flask
===============
[](https://travis-ci.org/jschaf/pylint-flask) [](https://coveralls.io/r/jschaf/pylint-flask?branch=master) [](https://pypi.python.org/pypi/pylint-flask) [](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
## About
`pylint-flask` is [Pylint](http://pylint.org) plugin for improving code
analysis when editing code using [Flask](http://flask.pocoo.org/).
Inspired by [pylint-django](https://github.com/landscapeio/pylint-django).
### Problems pylint-flask solves:
1. Recognize `flask.ext.*` style imports. Say you have the following code:
```python
from flask.ext import wtf
from flask.ext.wtf import validators
class PostForm(wtf.Form):
content = wtf.TextAreaField('Content', validators=[validators.Required()])
```
Normally, pylint will throw errors like:
```
E: 1,0: No name 'wtf' in module 'flask.ext'
E: 2,0: No name 'wtf' in module 'flask.ext'
F: 2,0: Unable to import 'flask.ext.wtf'
```
As pylint builds it's own abstract syntax tree, `pylint-flask` will translate
the `flask.ext` imports into the actual module name, so pylint can continue
checking your code.
## Usage
Ensure `pylint-flask` is installed and on your path, and then run pylint using
pylint-flask as a plugin.
```
pip install pylint-flask
pylint --load-plugins pylint_flask [..your module..]
```
## Contributing
Pull requests are always welcome. Here's an outline of the steps you need to
prepare your code.
1. git clone https://github.com/jschaf/pylint-flask.git
2. cd pylint-flask
3. mkvirtualenv pylint-flask
4. pip install -r dev-requirements.txt
5. git checkout -b MY-NEW-FIX
6. Hack away
7. Make sure everything is green by running `tox`
7. git push origin MY-NEW-FIX
8. Create a pull request
## License
pylint-flask is available under the GPLv2 license.