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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for flake8-django, version 1.1.1
Filename, size File type Python version Upload date Hashes
Filename, size flake8_django-1.1.1-py3-none-any.whl (23.5 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size flake8-django-1.1.1.tar.gz (7.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page