Skip to main content

Code quality tests

Project description

It is sometimes possible to tell that code stinks even without looking at it. This Django app tries to accomplish that.


pip install django-smelly-tokens


In your define SMELLY_TOKENS_APPLICATIONS list with packages you want to inspect.

In a package with code quality tests (e.g. import tests you want to check your apps against:

from smelly_tokens.test_smelly_tokens import (

Run test or ./ test or py.test or nose or whatever runner you’re using.


To silence known errors PEP8-style noqa comment can be used in the beginning of a file:

# smelly_tokens: noqa

Or in-line:

eval('print 123')  # noqa

To exclude an entire directory add it’s path to SMELLY_TOKENS_EXCLUDE_DIRS list in settings.

Adding your own tokens

To create a new type of smelly token test case, inherit SmellyTokensTestCase and override _tokens list:

from django.test import TestCase
from smelly_tokens.test_smelly_tokens import SmellyTokensTestCase

class OOPTokensTestCase(SmellyTokensTestCase, TestCase):
""" OOP hater. """
_tokens = ['class', 'object', 'Object']



0.4.4 (2018-06-06)

  • #movingtogitlab

0.4 (2017-05-06)

  • Introduced zest.releaser.
  • Released to PyPI.
  • Documentation.

0.3 (2017-05-02)

  • Python 2 / 3 compatibility.
  • Multiple tokens per class.

Project details

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
django_smelly_tokens-0.4.4-py2.py3-none-any.whl (4.0 kB) Copy SHA256 hash SHA256 Wheel py2.py3
django-smelly-tokens-0.4.4.tar.gz (6.9 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page