Skip to content

Instantly share code, notes, and snippets.

@vporoshok
Created August 28, 2014 07:08
Show Gist options
  • Save vporoshok/877c700fb1acf2909cf3 to your computer and use it in GitHub Desktop.
Save vporoshok/877c700fb1acf2909cf3 to your computer and use it in GitHub Desktop.
My tox.ini with tests, coverage, flake8 and pylint (default without refactory, docstring check and review, use `tox -e refactory` to see how you can get better code)
[tox]
envlist = flake8,pylint,py27,coverage
skipsdist = True
[tox:hudson]
downloadcache = {toxworkdir}/_download
[testenv:flake8]
deps = flake8
commands = flake8
[flake8]
exclude = .tox,migrations
[testenv:refactory]
deps = pylint
-rrequirements.txt
commands = pylint -d all -e CR {project_module_dir}
[testenv:pylint]
deps = pylint
-rrequirements.txt
commands = pylint --rcfile=tox.ini {project_module_dir}
[MESSAGES CONTROL]
; C0111 Missing docstring
; I0011: Locally disabling %s
; I0012: Locally enabling %s
; W0704 Except doesn't do anything Used when an except clause does nothing but "pass" and there is no "else" clause
; W0142 Used * or * magic* Used when a function or method is called using *args or **kwargs to dispatch arguments.
; W0212 Access to a protected member %s of a client class
; W0232 Class has no __init__ method Used when a class has no __init__ method, neither its parent classes.
; W0613 Unused argument %r Used when a function or method argument is not used.
; W0702 No exception's type specified Used when an except clause doesn't specify exceptions type to catch.
; R0201 Method could be a function
; W0614 Unused import XYZ from wildcard import
; R0903 Too few public methods
; R0904 Too many public methods
; R0914 Too many local variables
; R0912 Too many branches
; R0915 Too many statements
; R0913 Too many arguments
; R0923: Interface not implemented
disable=I0011,I0012,C0111,W0142,R
[REPORTS]
files-output=no
reports=no
evaluation=10.0 - ((float(5 * error + warning + convention) / statement) * 10)
[BASIC]
const-rgx=(([a-zA-Z_][a-zA-Z0-9_]*)|(__.*__))$
[testenv:py27]
deps = pytest
coverage
pytest-cov
-rrequirements.txt
commands = py.test --cov-config tox.ini \
--cov-report '' \
--cov {project_module_dir}
[testenv:coverage]
deps = coverage
commands = coverage report --rcfile=tox.ini --fail-under=50
[report]
show_missing = True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment