Skip to main content

Plugin to catch bad style specific to Django Projects

Project description

flake8-django

pypi CICodecov Downloads

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


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 details)

Uploaded Source

Built Distributions

flake8_django-1.1.0-py3.7.egg (24.6 kB view details)

Uploaded Source

flake8_django-1.1.0-py3.6.egg (24.5 kB view details)

Uploaded Source

flake8_django-1.1.0-py3-none-any.whl (23.5 kB view details)

Uploaded Python 3

File details

Details for the file flake8-django-1.1.0.tar.gz.

File metadata

  • Download URL: flake8-django-1.1.0.tar.gz
  • Upload date:
  • Size: 6.0 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

Hashes for flake8-django-1.1.0.tar.gz
Algorithm Hash digest
SHA256 93b101c6f683d94eeeb9c042261fda87e5e54c4f4e621549aade9ce39c1e4986
MD5 e97d3f363e3664e6ce743b85bace0093
BLAKE2b-256 b01b17bb56c8b261cbfb25832ca451a47289c74314e16ce89dd9e1ffe6b9c197

See more details on using hashes here.

Provenance

File details

Details for the file flake8_django-1.1.0-py3.7.egg.

File metadata

  • Download URL: flake8_django-1.1.0-py3.7.egg
  • Upload date:
  • Size: 24.6 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

Hashes for flake8_django-1.1.0-py3.7.egg
Algorithm Hash digest
SHA256 320f36bfe505e037e4609f93361f1024905dab48b7204d818dcd2863a55dccfd
MD5 00de3c86587144328636be71fe12c685
BLAKE2b-256 3fa652b27888a92f7e0514d5cb140b7af0d37f02399331f9d27638b27c4a962e

See more details on using hashes here.

Provenance

File details

Details for the file flake8_django-1.1.0-py3.6.egg.

File metadata

  • Download URL: flake8_django-1.1.0-py3.6.egg
  • Upload date:
  • Size: 24.5 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

Hashes for flake8_django-1.1.0-py3.6.egg
Algorithm Hash digest
SHA256 510a75351d7fa8447a6d89a04128b1516ab3371738d3382c981151849d9ff53b
MD5 7adee709eac5d2dd63ccb4d0ad25fb71
BLAKE2b-256 ca9af95cf1e3c1eed4ae1c26a24fb731f9d8d86a461e31bb213bd9d2786c5658

See more details on using hashes here.

Provenance

File details

Details for the file flake8_django-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: flake8_django-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 23.5 kB
  • Tags: Python 3
  • 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

Hashes for flake8_django-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 af88da63452b45e9bb5fdc2ddcdadbe0be13b0eaa55bd3e6906391f44f840e8f
MD5 e348a5979104411d1b00a0ef45389775
BLAKE2b-256 63dd53cd3bf109952d2e9b87fc84de4399c746d0cb35f82ee5e74f9d975edd2e

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page