Skip to content

Commit 689465b

Browse files
committed
Use human readable name for suppressed message
also remove couple of suppressions b/c these class checks are already handled by the check for meta class and they don't seem to have any effect
1 parent 03b1b71 commit 689465b

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

pylint_django/augmentations/__init__.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ def apply_augmentations(linter):
715715
suppress_message(linter, _visit_attribute(TypeChecker), 'E1101', generic_is_view_attribute(parents, attrs))
716716

717717
# formviews have too many ancestors, there's nothing the user of the library can do about that
718-
suppress_message(linter, _visit_class(MisdesignChecker), 'R0901', is_class('django.views.generic.edit.FormView'))
718+
suppress_message(linter, _visit_class(MisdesignChecker), 'too-many-ancestors', is_class('django.views.generic.edit.FormView'))
719719

720720
# model forms have no __init__ method anywhere in their bases
721721
suppress_message(linter, _visit_class(ClassChecker), 'W0232', is_class('django.forms.models.ModelForm'))
@@ -740,14 +740,6 @@ def apply_augmentations(linter):
740740
suppress_message(linter, _visit_class(ClassChecker), 'no-init', is_model_media_subclass)
741741
suppress_message(linter, _leave_class(MisdesignChecker), 'too-few-public-methods', is_model_media_subclass)
742742

743-
# Too few public methods started appearing for Views and Models as part of Pylint>=1.4 / astroid>=1.3.3
744-
# Not sure why, suspect this is a failure to get the parent classes somewhere
745-
# For now, just suppress it on models and views
746-
suppress_message(linter, _leave_class(MisdesignChecker), 'too-few-public-methods',
747-
is_class('.Model'))
748-
suppress_message(linter, _leave_class(MisdesignChecker), 'too-few-public-methods',
749-
is_class('.View'))
750-
751743
# Admin
752744
# Too many public methods (40+/20)
753745
# TODO: Count public methods of django.contrib.admin.options.ModelAdmin and increase

0 commit comments

Comments
 (0)