Commit baab3037 by Clinton Blackburn Committed by Clinton Blackburn

Restored Pylint

parent 1f8975e8
......@@ -48,7 +48,7 @@ test: clean
quality:
pep8 --config=.pep8 course_discovery *.py
#pylint --rcfile=pylintrc course_discovery *.py
pylint --rcfile=pylintrc course_discovery *.py
validate: test quality
......
......@@ -10,11 +10,13 @@ class CatalogSerializer(serializers.ModelSerializer):
fields = ('id', 'name', 'query',)
class CourseSerializer(serializers.Serializer):
class CourseSerializer(serializers.Serializer): # pylint: disable=abstract-method
id = serializers.CharField(help_text=_('Course ID'))
name = serializers.CharField(help_text=_('Course name'))
class ContainedCoursesSerializer(serializers.Serializer):
courses = serializers.DictField(child=serializers.BooleanField(),
help_text=_('Dictionary mapping course IDs to boolean values'))
class ContainedCoursesSerializer(serializers.Serializer): # pylint: disable=abstract-method
courses = serializers.DictField(
child=serializers.BooleanField(),
help_text=_('Dictionary mapping course IDs to boolean values')
)
......@@ -12,6 +12,7 @@ from course_discovery.apps.catalogs.models import Catalog
logger = logging.getLogger(__name__)
# pylint: disable=no-member
class CatalogViewSet(viewsets.ModelViewSet):
""" Catalog resource. """
......@@ -47,7 +48,7 @@ class CatalogViewSet(viewsets.ModelViewSet):
return super(CatalogViewSet, self).update(request, *args, **kwargs)
@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.
---
......@@ -62,7 +63,7 @@ class CatalogViewSet(viewsets.ModelViewSet):
return self.get_paginated_response(serializer.data)
@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.
......
......@@ -8,7 +8,7 @@ class Catalog(TimeStampedModel):
query = models.TextField(null=False, blank=False, help_text=_('Query to retrieve catalog contents'))
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):
""" Returns the list of courses contained within this catalog.
......@@ -18,7 +18,7 @@ class Catalog(TimeStampedModel):
"""
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.
Arguments:
......
......@@ -28,13 +28,13 @@ class UserTests(TestCase):
""" Test that the user model concatenates first and last name if the full name is not set. """
full_name = "George Costanza"
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"
last_name = "Seinfeld"
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)
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)
self.assertEquals(user.get_full_name(), full_name)
self.assertEqual(user.get_full_name(), full_name)
......@@ -42,7 +42,7 @@ urlpatterns = [
url('', include('social.apps.django_app.urls', namespace='social')),
]
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)))
......@@ -22,10 +22,9 @@
#
# ------------------------------
[MASTER]
profile = no
ignore = ,migrations, settings, wsgi.py
persistent = yes
load-plugins = edx_lint.pylint
load-plugins = edx_lint.pylint,pylint_django
[MESSAGES CONTROL]
disable =
......@@ -49,17 +48,15 @@ disable =
too-many-arguments,
too-many-locals,
unused-wildcard-import,
duplicate-code,invalid-name
duplicate-code,invalid-name,missing-docstring
[REPORTS]
output-format = text
files-output = no
reports = no
evaluation = 10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
comment = no
[BASIC]
required-attributes =
bad-functions = map,filter,apply,input
module-rgx = (([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
const-rgx = (([A-Z_][A-Z0-9_]*)|(__.*__)|log|urlpatterns|logger|User)$
......@@ -95,8 +92,7 @@ ignore-imports = no
[TYPECHECK]
ignore-mixin-members = yes
ignored-classes = SQLObject
zope = no
ignored-classes = SQLObject,WSGIRequest,UserFactory,CatalogFactory
unsafe-load-any-extension = yes
generated-members =
REQUEST,
......@@ -127,7 +123,6 @@ dummy-variables-rgx = _|dummy|unused|.*_unused
additional-builtins =
[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
valid-classmethod-first-arg = cls
valid-metaclass-classmethod-first-arg = mcs
......@@ -153,4 +148,4 @@ int-import-graph =
[EXCEPTIONS]
overgeneral-exceptions = Exception
# 304129eed6c04643faf6fa5d5070d2b0f6b44ff0
# d9dbd5cb8a05067710b776137902855c9ca7f6a6
[MASTER]
ignore+= ,migrations, settings, wsgi.py
load-plugins = edx_lint.pylint
[BASIC]
const-rgx = (([A-Z_][A-Z0-9_]*)|(__.*__)|log|urlpatterns|logger|User)$
[MESSAGES CONTROL]
DISABLE+= ,invalid-name
\ No newline at end of file
DISABLE+= ,invalid-name,missing-docstring
[TYPECHECK]
ignored-classes+= ,WSGIRequest,UserFactory,CatalogFactory
......@@ -5,9 +5,8 @@ coverage == 4.0.2
ddt==1.0.1
django-dynamic-fixture == 1.8.5
django-nose == 1.4.2
edx-lint == 0.3.2
edx-lint == 0.4.0
factory-boy==2.6.0
mock == 1.3.0
nose-ignore-docstring == 0.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