Commits

Andriy Kornatskyy committed e9f5263

Introduced make target qa; fixed issues reported.

  • Participants
  • Parent commits d4384ac

Comments (0)

Files changed (10)

-.SILENT: clean env doctest-cover test doc release upload
-.PHONY: clean env doctest-cover test doc release upload
+.SILENT: clean env doctest-cover qa test doc release upload
+.PHONY: clean env doctest-cover qa test doc release upload
 
 VERSION=2.7
 PYPI=http://pypi.python.org/simple
 		rotate --match=$(VERSION).egg --keep=1 --dist-dir=$(DIST_DIR) \
 		upload;
 
+qa:
+	if [ "$$(echo $(VERSION) | sed 's/\.//')" -eq 27 ]; then \
+		flake8 --max-complexity 10 demos doc src setup.py && \
+		pep8 demos doc src setup.py ; \
+	fi
+
 test:
 	$(PYTEST) -q -x --pep8 --doctest-modules \
 		src/wheezy/web

File demos/template/Makefile

 	export PYTHONPATH=$$PYTHONPATH:./src ; \
 		$(ENV)/bin/gunicorn -b 0.0.0.0:8080 -w 1 app:main
 
+qa:
+	if [ "$$(echo $(VERSION) | sed 's/\.//')" -eq 27 ]; then \
+		flake8 --max-complexity 6 src setup.py && \
+		pep8 src setup.py ; \
+	fi
+
 test:
 	echo $(TEMPLATE_ENGINE) ; export TEMPLATE_ENGINE=$(TEMPLATE_ENGINE) ; \
 	$(PYTEST) -q -x --pep8 --doctest-modules src/

File demos/template/setup.py

 try:
     from setuptools import setup
 except:
-    from distutils.core import setup
+    from distutils.core import setup  # noqa
 
 README = open(os.path.join(os.path.dirname(__file__), 'README')).read()
 
 install_requires += install_optional
 
 try:
-    import uuid
-except:
+    import uuid  # noqa
+except ImportError:
     install_requires.append('uuid')
 
 dependency_links = [

File demos/template/src/membership/repository/contract.py

 """
 """
 
-from wheezy.core.descriptors import attribute
-
 
 class IMembershipRepository(object):  # pragma: nocover
 
         return sorted([])
 
     def authenticate(self, credential):
-        assert isinstance(credential, Credential)
         return False
 
     def has_account(self, username):

File demos/template/src/public/web/tests/test_views.py

 try:
     import json
 except ImportError:  # pragma: nocover
-    json = None
+    json = None  # noqa
 
 
 from wheezy.http.functional import WSGIClient
 try:
     from setuptools import setup
 except:
-    from distutils.core import setup
+    from distutils.core import setup  # noqa
 
 README = open(os.path.join(os.path.dirname(__file__), 'README')).read()
 
 ]
 
 try:
-    import uuid
-except:
+    import uuid  # noqa
+except ImportError:
     install_requires.append('uuid')
 
 setup(

File src/wheezy/web/__init__.py

 """ ``web`` package.
 """
 
+# flake8: noqa
+
 from wheezy.web.authorization import authorize
 from wheezy.web.authorization import secure
 from wheezy.web.caching import handler_cache

File src/wheezy/web/handlers/__init__.py

 """ ``handlers`` package.
 """
 
+# flake8: noqa
+
 from wheezy.web.handlers.base import BaseHandler
 from wheezy.web.handlers.base import RedirectRouteHandler
 from wheezy.web.handlers.base import permanent_redirect_handler

File src/wheezy/web/middleware/__init__.py

 """ ``middleware`` package.
 """
 
+# flake8: noqa
+
 from wheezy.web.middleware.bootstrap import bootstrap_defaults
 from wheezy.web.middleware.errors import http_error_middleware_factory
 from wheezy.web.middleware.routing import path_routing_middleware_factory

File src/wheezy/web/templates.py

         try:  # pragma: nocover
             from webext import escape_html as escape
         except ImportError:  # pragma: nocover
-            from tenjin.helpers import escape
+            from tenjin.helpers import escape  # noqa
 
         from wheezy.core.comp import str_type
         self.helpers = {