From 47277707914878749c2d3ef9c7f3f07ead5bcc75 Mon Sep 17 00:00:00 2001 From: hvelarde Date: Wed, 19 Dec 2012 11:16:59 -0200 Subject: [PATCH] use flake8 instead of pep8 and pyflakes --- Makefile | 18 ++++++++++++------ quality-assurance.cfg | 16 ++++++---------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index fafb278..2975f97 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,11 @@ -# convenience makefile to boostrap & run buildout -# use `make options=-v` to run buildout with extra options +# convenience Makefile to run tests and QA tools +# options: zc.buildout options +# src: source path +# minimum_coverage: minimun test coverage allowed +# pep8_ignores: ignore listed PEP 8 errors and warnings +# max_complexity: maximum McCabe complexity allowed +# css_ignores: skip file names matching find pattern (use ! -name PATTERN) +# js_ignores: skip file names matching find pattern (use ! -name PATTERN) SHELL = /bin/sh @@ -7,8 +13,9 @@ options = -N -q -t 3 src = src/collective/upload/ minimum_coverage = 69 pep8_ignores = E501 -css_ignores = ! -name bootstrap\* ! -name jquery\* -js_ignores = ! -name bootstrap\* ! -name jquery\* +max_complexity = 12 +css_ignores = ! -name jquery\* +js_ignores = ! -name jquery\* ack-install: sudo apt-get install ack-grep @@ -26,8 +33,7 @@ jshint-install: nodejs-install python-validation: @echo Validating Python files - bin/pep8 --ignore=$(pep8_ignores) $(src) - bin/pyflakes $(src) + bin/flake8 --ignore=$(pep8_ignores) --max-complexity=$(max_complexity) $(src) css-validation: ack-install csslint-install @echo Validating CSS files diff --git a/quality-assurance.cfg b/quality-assurance.cfg index 6b8c0d3..73be745 100644 --- a/quality-assurance.cfg +++ b/quality-assurance.cfg @@ -1,18 +1,14 @@ [buildout] parts += createzopecoverage - pep8 - pyflakes + flake8 [createzopecoverage] recipe = createzopecoverage -[pep8] +[flake8] recipe = zc.recipe.egg -eggs = pep8 - -[pyflakes] -recipe = zc.recipe.egg -scripts = pyflakes -eggs = pyflakes -entry-points = pyflakes=pyflakes.scripts.pyflakes:main +eggs = + flake8 + ${buildout:eggs} +entry-points = flake8=flake8.run:main \ No newline at end of file