Plugin to catch bad style specific to Django Projects
Project description
flake8-django
A flake8 plugin for 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 warnings
Warning | Description |
---|---|
DJ01 |
Using null=True is not recommended for some of the Django ORM fields. E.g. CharField , EmailField , ImageField , FileField , UUIDField , SlugField , TextField |
DJ03 |
Using locals() in render function is not recommended, use explicit arguments |
DJ05 |
URLs include() should set a namespace |
DJ06 |
ModelForm should not set exclude, instead it should use fields, which is an explicit list of all the fields that should be included in the form |
DJ07 |
ModelForm.Meta should not set fields to __all__ |
DJ08 |
Models that inherits from django db models should set __str__ |
DJ09 |
Model must define class Meta |
DJ10 |
Class Meta from Model has to define verbose_name |
DJ11 |
Class Meta from Model has to define verbose_name_plural |
DJ12 |
Order of model inner classes and standard methods does not follow Django style guide |
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.0.0.tar.gz
(6.6 kB
view details)
Built Distribution
flake8_django-1.0.0-py3.8.egg
(24.4 kB
view details)
File details
Details for the file flake8-django-1.0.0.tar.gz
.
File metadata
- Download URL: flake8-django-1.0.0.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.5.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c9e4b8bdcad3084d3a335a0e305cbf66cd9a2af937d66c50c859c1f966036b2 |
|
MD5 | ce965c9f4b46c35243dad31ff7ed00fb |
|
BLAKE2b-256 | e86da1bb65b4eb9be639e7b91747bb8b9a141c6eab59c1e5cde77e6bf052b515 |
Provenance
File details
Details for the file flake8_django-1.0.0-py3.8.egg
.
File metadata
- Download URL: flake8_django-1.0.0-py3.8.egg
- Upload date:
- Size: 24.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba9e64a9ac9999e1ad1a71c2dedbed24639c7db9656915bcc33610c410094f60 |
|
MD5 | b7db6e86d33cbc48422cfe169b902385 |
|
BLAKE2b-256 | 908a12accad942fe1849e4bd5d8585e9bccc69b323254a4e260d2e01613c775e |