Skip to content
Snippets Groups Projects
Commit 70bc54b7 authored by Mr. Senko's avatar Mr. Senko Committed by Alexander Todorov
Browse files

Suppress invalid-name for wsgi application. Fix #77

parent 3d85a4d1
No related branches found
No related tags found
No related merge requests found
......@@ -700,6 +700,12 @@ def wrap(orig_method, with_method):
return wrap_func
def is_wsgi_application(node):
frame = node.frame()
return node.name == 'application' and isinstance(frame, Module) and \
(frame.name == 'wsgi' or frame.path.endswith('wsgi.py') or frame.file.endswith('wsgi.py'))
# The names of some visit functions changed in this commit:
# https://bitbucket.org/logilab/pylint/commits/c94ee95abaa5737f13b91626fe321150c0ddd140
......@@ -822,3 +828,6 @@ def apply_augmentations(linter):
# supress not-an-iterable for model_utils.managers. See #117
suppress_message(linter, IterableChecker._check_iterable, 'not-an-iterable', is_model_manager)
# wsgi.py
suppress_message(linter, _visit_assignname(NameChecker), 'invalid-name', is_wsgi_application)
"""
Standard WSGI config created by django-admin startproject.
Used to verify pylint_django doesn't produce invalid-name for
the application variable. See:
https://github.com/PyCQA/pylint-django/issues/77
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "testproj.settings")
application = get_wsgi_application()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment