Commit baab3037 by Clinton Blackburn Committed by Clinton Blackburn

Restored Pylint

parent 1f8975e8
...@@ -48,7 +48,7 @@ test: clean ...@@ -48,7 +48,7 @@ test: clean
quality: quality:
pep8 --config=.pep8 course_discovery *.py pep8 --config=.pep8 course_discovery *.py
#pylint --rcfile=pylintrc course_discovery *.py pylint --rcfile=pylintrc course_discovery *.py
validate: test quality validate: test quality
......
...@@ -10,11 +10,13 @@ class CatalogSerializer(serializers.ModelSerializer): ...@@ -10,11 +10,13 @@ class CatalogSerializer(serializers.ModelSerializer):
fields = ('id', 'name', 'query',) fields = ('id', 'name', 'query',)
class CourseSerializer(serializers.Serializer): class CourseSerializer(serializers.Serializer): # pylint: disable=abstract-method
id = serializers.CharField(help_text=_('Course ID')) id = serializers.CharField(help_text=_('Course ID'))
name = serializers.CharField(help_text=_('Course name')) name = serializers.CharField(help_text=_('Course name'))
class ContainedCoursesSerializer(serializers.Serializer): class ContainedCoursesSerializer(serializers.Serializer): # pylint: disable=abstract-method
courses = serializers.DictField(child=serializers.BooleanField(), courses = serializers.DictField(
help_text=_('Dictionary mapping course IDs to boolean values')) child=serializers.BooleanField(),
help_text=_('Dictionary mapping course IDs to boolean values')
)
...@@ -12,6 +12,7 @@ from course_discovery.apps.catalogs.models import Catalog ...@@ -12,6 +12,7 @@ from course_discovery.apps.catalogs.models import Catalog
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
# pylint: disable=no-member
class CatalogViewSet(viewsets.ModelViewSet): class CatalogViewSet(viewsets.ModelViewSet):
""" Catalog resource. """ """ Catalog resource. """
...@@ -47,7 +48,7 @@ class CatalogViewSet(viewsets.ModelViewSet): ...@@ -47,7 +48,7 @@ class CatalogViewSet(viewsets.ModelViewSet):
return super(CatalogViewSet, self).update(request, *args, **kwargs) return super(CatalogViewSet, self).update(request, *args, **kwargs)
@detail_route() @detail_route()
def courses(self, request, id=None): def courses(self, request, id=None): # pylint: disable=redefined-builtin,unused-argument
""" """
Retrieve the list of courses contained within this catalog. Retrieve the list of courses contained within this catalog.
--- ---
...@@ -62,7 +63,7 @@ class CatalogViewSet(viewsets.ModelViewSet): ...@@ -62,7 +63,7 @@ class CatalogViewSet(viewsets.ModelViewSet):
return self.get_paginated_response(serializer.data) return self.get_paginated_response(serializer.data)
@detail_route() @detail_route()
def contains(self, request, id=None): def contains(self, request, id=None): # pylint: disable=redefined-builtin,unused-argument
""" """
Determine if this catalog contains the provided courses. Determine if this catalog contains the provided courses.
......
...@@ -8,7 +8,7 @@ class Catalog(TimeStampedModel): ...@@ -8,7 +8,7 @@ class Catalog(TimeStampedModel):
query = models.TextField(null=False, blank=False, help_text=_('Query to retrieve catalog contents')) query = models.TextField(null=False, blank=False, help_text=_('Query to retrieve catalog contents'))
def __str__(self): def __str__(self):
return 'Catalog #{id}: {name}'.format(id=self.id, name=self.name) return 'Catalog #{id}: {name}'.format(id=self.id, name=self.name) # pylint: disable=no-member
def courses(self): def courses(self):
""" Returns the list of courses contained within this catalog. """ Returns the list of courses contained within this catalog.
...@@ -18,7 +18,7 @@ class Catalog(TimeStampedModel): ...@@ -18,7 +18,7 @@ class Catalog(TimeStampedModel):
""" """
return [] return []
def contains(self, course_ids): def contains(self, course_ids): # pylint: disable=unused-argument
""" Determines if the given courses are contained in this catalog. """ Determines if the given courses are contained in this catalog.
Arguments: Arguments:
......
...@@ -28,13 +28,13 @@ class UserTests(TestCase): ...@@ -28,13 +28,13 @@ class UserTests(TestCase):
""" Test that the user model concatenates first and last name if the full name is not set. """ """ Test that the user model concatenates first and last name if the full name is not set. """
full_name = "George Costanza" full_name = "George Costanza"
user = G(User, full_name=full_name) user = G(User, full_name=full_name)
self.assertEquals(user.get_full_name(), full_name) self.assertEqual(user.get_full_name(), full_name)
first_name = "Jerry" first_name = "Jerry"
last_name = "Seinfeld" last_name = "Seinfeld"
user = G(User, full_name=None, first_name=first_name, last_name=last_name) user = G(User, full_name=None, first_name=first_name, last_name=last_name)
expected = "{first_name} {last_name}".format(first_name=first_name, last_name=last_name) expected = "{first_name} {last_name}".format(first_name=first_name, last_name=last_name)
self.assertEquals(user.get_full_name(), expected) self.assertEqual(user.get_full_name(), expected)
user = G(User, full_name=full_name, first_name=first_name, last_name=last_name) user = G(User, full_name=full_name, first_name=first_name, last_name=last_name)
self.assertEquals(user.get_full_name(), full_name) self.assertEqual(user.get_full_name(), full_name)
...@@ -42,7 +42,7 @@ urlpatterns = [ ...@@ -42,7 +42,7 @@ urlpatterns = [
url('', include('social.apps.django_app.urls', namespace='social')), url('', include('social.apps.django_app.urls', namespace='social')),
] ]
if settings.DEBUG and os.environ.get('ENABLE_DJANGO_TOOLBAR', False): # pragma: no cover if settings.DEBUG and os.environ.get('ENABLE_DJANGO_TOOLBAR', False): # pragma: no cover
import debug_toolbar # pylint: disable=import-error import debug_toolbar # pylint: disable=wrong-import-position,import-error
urlpatterns.append(url(r'^__debug__/', include(debug_toolbar.urls))) urlpatterns.append(url(r'^__debug__/', include(debug_toolbar.urls)))
...@@ -22,10 +22,9 @@ ...@@ -22,10 +22,9 @@
# #
# ------------------------------ # ------------------------------
[MASTER] [MASTER]
profile = no
ignore = ,migrations, settings, wsgi.py ignore = ,migrations, settings, wsgi.py
persistent = yes persistent = yes
load-plugins = edx_lint.pylint load-plugins = edx_lint.pylint,pylint_django
[MESSAGES CONTROL] [MESSAGES CONTROL]
disable = disable =
...@@ -49,17 +48,15 @@ disable = ...@@ -49,17 +48,15 @@ disable =
too-many-arguments, too-many-arguments,
too-many-locals, too-many-locals,
unused-wildcard-import, unused-wildcard-import,
duplicate-code,invalid-name duplicate-code,invalid-name,missing-docstring
[REPORTS] [REPORTS]
output-format = text output-format = text
files-output = no files-output = no
reports = no reports = no
evaluation = 10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) evaluation = 10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
comment = no
[BASIC] [BASIC]
required-attributes =
bad-functions = map,filter,apply,input bad-functions = map,filter,apply,input
module-rgx = (([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ module-rgx = (([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
const-rgx = (([A-Z_][A-Z0-9_]*)|(__.*__)|log|urlpatterns|logger|User)$ const-rgx = (([A-Z_][A-Z0-9_]*)|(__.*__)|log|urlpatterns|logger|User)$
...@@ -95,8 +92,7 @@ ignore-imports = no ...@@ -95,8 +92,7 @@ ignore-imports = no
[TYPECHECK] [TYPECHECK]
ignore-mixin-members = yes ignore-mixin-members = yes
ignored-classes = SQLObject ignored-classes = SQLObject,WSGIRequest,UserFactory,CatalogFactory
zope = no
unsafe-load-any-extension = yes unsafe-load-any-extension = yes
generated-members = generated-members =
REQUEST, REQUEST,
...@@ -127,7 +123,6 @@ dummy-variables-rgx = _|dummy|unused|.*_unused ...@@ -127,7 +123,6 @@ dummy-variables-rgx = _|dummy|unused|.*_unused
additional-builtins = additional-builtins =
[CLASSES] [CLASSES]
ignore-iface-methods = isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by
defining-attr-methods = __init__,__new__,setUp defining-attr-methods = __init__,__new__,setUp
valid-classmethod-first-arg = cls valid-classmethod-first-arg = cls
valid-metaclass-classmethod-first-arg = mcs valid-metaclass-classmethod-first-arg = mcs
...@@ -153,4 +148,4 @@ int-import-graph = ...@@ -153,4 +148,4 @@ int-import-graph =
[EXCEPTIONS] [EXCEPTIONS]
overgeneral-exceptions = Exception overgeneral-exceptions = Exception
# 304129eed6c04643faf6fa5d5070d2b0f6b44ff0 # d9dbd5cb8a05067710b776137902855c9ca7f6a6
[MASTER] [MASTER]
ignore+= ,migrations, settings, wsgi.py ignore+= ,migrations, settings, wsgi.py
load-plugins = edx_lint.pylint
[BASIC] [BASIC]
const-rgx = (([A-Z_][A-Z0-9_]*)|(__.*__)|log|urlpatterns|logger|User)$ const-rgx = (([A-Z_][A-Z0-9_]*)|(__.*__)|log|urlpatterns|logger|User)$
[MESSAGES CONTROL] [MESSAGES CONTROL]
DISABLE+= ,invalid-name DISABLE+= ,invalid-name,missing-docstring
\ No newline at end of file
[TYPECHECK]
ignored-classes+= ,WSGIRequest,UserFactory,CatalogFactory
...@@ -5,9 +5,8 @@ coverage == 4.0.2 ...@@ -5,9 +5,8 @@ coverage == 4.0.2
ddt==1.0.1 ddt==1.0.1
django-dynamic-fixture == 1.8.5 django-dynamic-fixture == 1.8.5
django-nose == 1.4.2 django-nose == 1.4.2
edx-lint == 0.3.2 edx-lint == 0.4.0
factory-boy==2.6.0 factory-boy==2.6.0
mock == 1.3.0 mock == 1.3.0
nose-ignore-docstring == 0.2 nose-ignore-docstring == 0.2
pep8 == 1.6.2 pep8 == 1.6.2
#pylint == 1.4.4
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment