Skip to content

Cleaning #207

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions pylint_django/augmentations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
21 changes: 1 addition & 20 deletions pylint_django/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -21,23 +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)


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