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.1.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: flake8-django-1.1.1.tar.gz
  • Upload date:
  • Size: 7.7 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.1.tar.gz
Algorithm Hash digest
SHA256 fb4e8f669d3cf44297bb6e1c5d0a358ab0aba373cd4c69268cf2798de6bcbd9b
MD5 05fac37ec1b99b542927e371c5a0fcc4
BLAKE2b-256 9d66f8efb5648770ba1153e2a3edcce2c77cdd83a728b91e1529b96e1e52c587

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: flake8_django-1.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c71da0e61b6119dae91cbffdbdb00f1d6ebe3f5d0c43f5bf136929997ab0b72d
MD5 837418ac2ce4ee6efbd30dd358491a7c
BLAKE2b-256 00a12457403ec15c534b6e1dea562d63e6017cf6bb39b8b1e7f850b0a1d3ef7c

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