Plugin to catch bad style specific to Django Projects
Project description
flake8-django
A flake8 plugin to detect bad practices on Django projects.
Installation
Install from pip with:
$ pip install flake8-django
Testing
flake8-django uses pytest for tests. To run them use:
$ pytest
Run coverage report using:
$ pytest --cov=.
List of Rules
Rule | Description |
---|---|
DJ01 |
Avoid using null=True on string-based fields such as CharField and TextField |
DJ03 |
Avoid passing locals() as context to a render function |
DJ06 |
Do not use exclude with ModelForm, use fields instead |
DJ07 |
Do not use __all__ with ModelForm, use fields instead |
DJ08 |
Model does not define __str__ method |
DJ12 |
Order of Model's inner classes, methods, and fields does not follow the Django Style Guide |
More details about each of the Rules can be found on the wiki page.
Licence
GPL
Thanks
@stummjr for teaching me AST, and what I could do with it. His blog is cool.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
flake8-django-1.1.0.tar.gz
(6.0 kB
view hashes)
Built Distributions
flake8_django-1.1.0-py3.7.egg
(24.6 kB
view hashes)
flake8_django-1.1.0-py3.6.egg
(24.5 kB
view hashes)
Close
Hashes for flake8_django-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af88da63452b45e9bb5fdc2ddcdadbe0be13b0eaa55bd3e6906391f44f840e8f |
|
MD5 | e348a5979104411d1b00a0ef45389775 |
|
BLAKE2b-256 | 63dd53cd3bf109952d2e9b87fc84de4399c746d0cb35f82ee5e74f9d975edd2e |