From 528bc3bdffd2dc235883d8306b51086e8a58b28b Mon Sep 17 00:00:00 2001 From: carlio Date: Thu, 29 Nov 2018 07:01:51 +0100 Subject: [PATCH 1/4] [refs #205] Cleaning up some old compatability code --- pylint_django/augmentations/__init__.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pylint_django/augmentations/__init__.py b/pylint_django/augmentations/__init__.py index 2981fc48..543d7429 100644 --- a/pylint_django/augmentations/__init__.py +++ b/pylint_django/augmentations/__init__.py @@ -787,12 +787,6 @@ def apply_augmentations(linter): # model forms have no __init__ method anywhere in their bases suppress_message(linter, ClassChecker.visit_classdef, 'W0232', is_class('django.forms.models.ModelForm')) - # forms implement __getitem__ but not __len__, thus raising a "Badly implemented container" warning which - # we will suppress. NOTE: removed from pylint, https://github.com/PyCQA/pylint/issues/112 - # keeping here in case it gets re-implemented - # suppress_message(linter, _leave_classdef(MisdesignChecker), 'R0924', is_class('django.forms.forms.Form')) - # suppress_message(linter, _leave_classdef(MisdesignChecker), 'R0924', is_class('django.forms.models.ModelForm')) - # Meta suppress_message(linter, DocStringChecker.visit_classdef, 'missing-docstring', is_model_meta_subclass) pylint_newstyle_classdef_compat(linter, 'old-style-class', is_model_meta_subclass) From 90e313fca59b068f09341a7fbbb69999f895751c Mon Sep 17 00:00:00 2001 From: carlio Date: Thu, 29 Nov 2018 07:03:14 +0100 Subject: [PATCH 2/4] [refs #205] Removing old fixes for misspeplled methods from old pylint versions --- pylint_django/compat.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/pylint_django/compat.py b/pylint_django/compat.py index 6d70e2bc..4d9bdac2 100644 --- a/pylint_django/compat.py +++ b/pylint_django/compat.py @@ -28,16 +28,3 @@ # if not available, will be handled by the django_installed checker django_version = (1, 5) - -def inferred(node): - if hasattr(node, "inferred"): - return node.inferred - else: - return node.infered - - -def instantiate_class(node): - if hasattr(node, "instantiate_class"): - return node.instantiate_class - else: - return node.instanciate_class From 5e99c51a1ba34e8f6518865a4db342ec1500d323 Mon Sep 17 00:00:00 2001 From: carlio Date: Thu, 29 Nov 2018 07:04:20 +0100 Subject: [PATCH 3/4] [refs #205] annotating YES/Uninferable compat change --- pylint_django/compat.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pylint_django/compat.py b/pylint_django/compat.py index 4d9bdac2..66776987 100644 --- a/pylint_django/compat.py +++ b/pylint_django/compat.py @@ -13,6 +13,7 @@ Getattr as Attribute, ) +# pylint 2.04->2.2 : YES was renamed to Uninferable, then YES became deprecated, then was removed try: from astroid.bases import YES as Uninferable except ImportError: From 633a68b600153a59a2994607944c17af4b7593af Mon Sep 17 00:00:00 2001 From: "Mr. Senko" Date: Fri, 14 Dec 2018 11:44:08 +0200 Subject: [PATCH 4/4] Remove unnecessary django_version compat this is not really used and elsewhere we do: from django import VERSION as django_version --- pylint_django/compat.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/pylint_django/compat.py b/pylint_django/compat.py index 66776987..590cd8f2 100644 --- a/pylint_django/compat.py +++ b/pylint_django/compat.py @@ -22,10 +22,3 @@ except ImportError: from astroid.util import Uninferable -try: - django = __import__("django") - django_version = django.VERSION -except ImportError: - # if not available, will be handled by the django_installed checker - django_version = (1, 5) -