From f0c21074d8c717281727ea47b08c1b13ae923456 Mon Sep 17 00:00:00 2001 From: Sander Maijers <3374183+sanmai-NL@users.noreply.github.com> Date: Sun, 9 Feb 2020 17:13:44 +0100 Subject: [PATCH 1/4] Support ASGI --- pylint_django/augmentations/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pylint_django/augmentations/__init__.py b/pylint_django/augmentations/__init__.py index e07f3700..c101084e 100644 --- a/pylint_django/augmentations/__init__.py +++ b/pylint_django/augmentations/__init__.py @@ -743,6 +743,7 @@ def wrap_func(*args, **kwargs): def is_wsgi_application(node): frame = node.frame() return node.name == 'application' and isinstance(frame, Module) and \ + (frame.name == 'asgi' or frame.path[0].endswith('asgi.py') or frame.file.endswith('asgi.py') or \ (frame.name == 'wsgi' or frame.path[0].endswith('wsgi.py') or frame.file.endswith('wsgi.py')) From 51297665b78521594a6221b30e2d122b209d76bd Mon Sep 17 00:00:00 2001 From: Sander Maijers <3374183+sanmai-NL@users.noreply.github.com> Date: Sun, 9 Feb 2020 17:45:41 +0100 Subject: [PATCH 2/4] Add parenthesis to fix syntax error --- pylint_django/augmentations/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pylint_django/augmentations/__init__.py b/pylint_django/augmentations/__init__.py index c101084e..423479a5 100644 --- a/pylint_django/augmentations/__init__.py +++ b/pylint_django/augmentations/__init__.py @@ -743,7 +743,7 @@ def wrap_func(*args, **kwargs): def is_wsgi_application(node): frame = node.frame() return node.name == 'application' and isinstance(frame, Module) and \ - (frame.name == 'asgi' or frame.path[0].endswith('asgi.py') or frame.file.endswith('asgi.py') or \ + ((frame.name == 'asgi' or frame.path[0].endswith('asgi.py') or frame.file.endswith('asgi.py') or \ (frame.name == 'wsgi' or frame.path[0].endswith('wsgi.py') or frame.file.endswith('wsgi.py')) From 9baf1f32f63441277150420b85ec650823f49a1b Mon Sep 17 00:00:00 2001 From: Sander Maijers <3374183+sanmai-NL@users.noreply.github.com> Date: Sun, 9 Feb 2020 17:50:28 +0100 Subject: [PATCH 3/4] Fix parentheses again --- pylint_django/augmentations/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pylint_django/augmentations/__init__.py b/pylint_django/augmentations/__init__.py index 423479a5..7be6cd9a 100644 --- a/pylint_django/augmentations/__init__.py +++ b/pylint_django/augmentations/__init__.py @@ -743,8 +743,8 @@ def wrap_func(*args, **kwargs): def is_wsgi_application(node): frame = node.frame() return node.name == 'application' and isinstance(frame, Module) and \ - ((frame.name == 'asgi' or frame.path[0].endswith('asgi.py') or frame.file.endswith('asgi.py') or \ - (frame.name == 'wsgi' or frame.path[0].endswith('wsgi.py') or frame.file.endswith('wsgi.py')) + (frame.name == 'asgi' or frame.path[0].endswith('asgi.py') or frame.file.endswith('asgi.py') or \ + frame.name == 'wsgi' or frame.path[0].endswith('wsgi.py') or frame.file.endswith('wsgi.py')) # Compat helpers From ec3493701fff81778bf85fab4ee1399128866f9c Mon Sep 17 00:00:00 2001 From: Sander Maijers <3374183+sanmai-NL@users.noreply.github.com> Date: Mon, 10 Feb 2020 14:30:52 +0100 Subject: [PATCH 4/4] Fix flake8 issues --- pylint_django/augmentations/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pylint_django/augmentations/__init__.py b/pylint_django/augmentations/__init__.py index 7be6cd9a..473ebc80 100644 --- a/pylint_django/augmentations/__init__.py +++ b/pylint_django/augmentations/__init__.py @@ -743,8 +743,8 @@ def wrap_func(*args, **kwargs): def is_wsgi_application(node): frame = node.frame() return node.name == 'application' and isinstance(frame, Module) and \ - (frame.name == 'asgi' or frame.path[0].endswith('asgi.py') or frame.file.endswith('asgi.py') or \ - frame.name == 'wsgi' or frame.path[0].endswith('wsgi.py') or frame.file.endswith('wsgi.py')) + (frame.name == 'asgi' or frame.path[0].endswith('asgi.py') or frame.file.endswith('asgi.py') or + frame.name == 'wsgi' or frame.path[0].endswith('wsgi.py') or frame.file.endswith('wsgi.py')) # Compat helpers