Skip to content

Commit 91d5b97

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 4cafb85 commit 91d5b97

File tree

50 files changed

+49
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+49
-1
lines changed

pylint_django/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""pylint_django module."""
22

3-
43
from pylint_django import plugin
54

65
register = plugin.register # pylint: disable=invalid-name

pylint_django/__pkginfo__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
"""pkginfo."""
2+
23
BASE_ID = 51

pylint_django/augmentations/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Augmentations."""
2+
23
# pylint: disable=invalid-name
34
import functools
45
import itertools

pylint_django/checkers/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Checkers."""
2+
23
from pylint_django.checkers.auth_user import AuthUserChecker
34
from pylint_django.checkers.django_installed import DjangoInstalledChecker
45
from pylint_django.checkers.foreign_key_strings import ForeignKeyStringsChecker

pylint_django/checkers/forms.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Models."""
2+
23
from astroid.nodes import Assign, AssignName, ClassDef
34
from pylint.checkers import BaseChecker
45

pylint_django/checkers/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Models."""
2+
23
from astroid import Const
34
from astroid.nodes import Assign, AssignName, ClassDef, FunctionDef
45
from pylint.checkers import BaseChecker

pylint_django/plugin.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Common Django module."""
2+
23
# we want to import the transforms to make sure they get added to the astroid manager,
34
# however we don't actually access them directly, so we'll disable the warning
45
from pylint_django import compat

pylint_django/tests/input/external_drf_noerror_serializer.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Checks that Pylint does not complain about DRF serializers
33
"""
4+
45
# pylint: disable=C0111,W5101,use-symbolic-message-instead
56

67
from rest_framework import serializers

pylint_django/tests/input/external_factory_boy_noerror.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Test to validate that pylint_django doesn't produce
33
Instance of 'SubFactory' has no 'pk' member (no-member) warnings
44
"""
5+
56
# pylint: disable=attribute-defined-outside-init, missing-docstring, too-few-public-methods
67
import factory
78
from django import test

pylint_django/tests/input/external_psycopg2_noerror_postgres_fields.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Checks that Pylint does not complain Postgres model fields.
33
"""
4+
45
# pylint: disable=C0111,W5101
56
from __future__ import print_function
67

pylint_django/tests/input/external_tastypie_noerror_foreign_key.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
The issue is the lint trys resolving the `ForeignKey` for the
1010
tastypie `ForeignKey` which cause import error.
1111
"""
12+
1213
from tastypie import fields
1314
from tastypie.fields import ForeignKey
1415

pylint_django/tests/input/func_model_does_not_use_unicode_py33.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Ensures that under PY3 django models with a __unicode__ method are flagged
33
"""
4+
45
# pylint: disable=missing-docstring
56

67
from django.db import models

pylint_django/tests/input/func_model_no_explicit_unicode_str_compat.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
python_2_unicode_compatible decorator applied are flagged correctly as not
44
having explicitly defined __unicode__
55
"""
6+
67
# pylint: disable=missing-docstring
78

89
from django.db import models

pylint_django/tests/input/func_modelform_exclude.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Checks that Pylint complains about ModelForm using exclude
33
"""
4+
45
# pylint: disable=missing-docstring
56
from django import forms
67

pylint_django/tests/input/func_noerror_classviews.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Checks that Pylint does not complain about attributes and methods
33
when using Class-based Views
44
"""
5+
56
# pylint: disable=missing-docstring
67

78
from django.db import models

pylint_django/tests/input/func_noerror_duplicate_except_doesnotexist.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
except blocks catching DoesNotExist exceptions:
44
https://github.com/PyCQA/pylint-django/issues/81
55
"""
6+
67
# pylint: disable=missing-docstring
78
from django.db import models
89

pylint_django/tests/input/func_noerror_factory_post_generation.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Checks that Pylint does not complain about no self argument in
33
factory.post_generation method.
44
"""
5+
56
# pylint: disable=missing-docstring,too-few-public-methods,unused-argument,no-member
67
import factory
78

pylint_django/tests/input/func_noerror_foreign_key_attributes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Checks that Pylint does not complain about foreign key sets on models
33
"""
4+
45
# pylint: disable=missing-docstring consider-using-f-string
56

67
from django.db import models

pylint_django/tests/input/func_noerror_foreign_key_ids.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Checks that Pylint does not complain about foreign key id access
33
"""
4+
45
# pylint: disable=missing-docstring,wrong-import-position
56
from django.db import models
67

pylint_django/tests/input/func_noerror_foreign_key_key_cls_unbound.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Checks that Pylint does not complain about ForeignKey pointing to model
33
in module of models package
44
"""
5+
56
# pylint: disable=missing-docstring
67
from django.db import models
78

pylint_django/tests/input/func_noerror_foreign_key_package.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Checks that Pylint does not complain about ForeignKey pointing to model
33
in module of models package
44
"""
5+
56
# pylint: disable=missing-docstring
67
from django.db import models
78

pylint_django/tests/input/func_noerror_foreign_key_sets.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Checks that Pylint does not complain about foreign key sets on models
33
"""
4+
45
# pylint: disable=missing-docstring
56

67
from django.db import models

pylint_django/tests/input/func_noerror_foreignkeys.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Checks that Pylint does not complain about various
33
methods on Django model fields.
44
"""
5+
56
# pylint: disable=missing-docstring,wrong-import-position
67
from django.db import models
78
from django.db.models import ForeignKey, OneToOneField

pylint_django/tests/input/func_noerror_form_fields.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Checks that Pylint does not complain about various
33
methods on Django form forms.
44
"""
5+
56
# pylint: disable=missing-docstring
67
from __future__ import print_function
78

pylint_django/tests/input/func_noerror_forms_py33.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Checks that Pylint does not complain about django Forms
33
"""
4+
45
# pylint: disable=missing-docstring,wrong-import-position
56

67
from django import forms

pylint_django/tests/input/func_noerror_formview_ancestors.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Checks that Pylint does not complain about django FormViews
33
having too many ancestors
44
"""
5+
56
# pylint: disable=missing-docstring
67
from django.views.generic import FormView
78

pylint_django/tests/input/func_noerror_generic_foreign_key.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Checks that Pylint does not complain about GenericForeignKey fields:
33
https://github.com/PyCQA/pylint-django/issues/230
44
"""
5+
56
# pylint: disable=missing-docstring
67

78
from django.contrib.contenttypes.fields import GenericForeignKey

pylint_django/tests/input/func_noerror_gettext_lazy_format.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Checks that Pylint does not complain about django lazy proxy
33
when using gettext_lazy
44
"""
5+
56
from django.utils.translation import gettext_lazy
67

78
gettext_lazy("{something}").format(something="lala")

pylint_django/tests/input/func_noerror_ignore_meta_subclass.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
This test ensures that a 'Meta' class defined on a Django model does
33
not raise warnings such as 'old-style-class' and 'too-few-public-methods'
44
"""
5+
56
# pylint: disable=missing-docstring
67

78
from django.db import models
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""
22
Checks that Pylint does not complain about import of Q.
33
"""
4+
45
# pylint: disable=missing-docstring,unused-import
56
from django.db.models import Q # noqa: F401

pylint_django/tests/input/func_noerror_issue_46.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Checks that Pylint does not complain about raising DoesNotExist
33
"""
4+
45
# pylint: disable=missing-docstring
56
from django.db import models
67

pylint_django/tests/input/func_noerror_manytomanyfield.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Checks that Pylint does not complain about various
33
methods on many-to-many relationships
44
"""
5+
56
from django.contrib.auth.models import AbstractUser, Permission
67

78
# pylint: disable=missing-docstring

pylint_django/tests/input/func_noerror_model_fields.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Checks that Pylint does not complain about various
33
methods on Django model fields.
44
"""
5+
56
# pylint: disable=missing-docstring
67
from __future__ import print_function
78

pylint_django/tests/input/func_noerror_model_methods.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Checks that Pylint does not complain about using Model and Manager methods
33
"""
4+
45
# pylint: disable=missing-docstring
56
from django.db import models
67

pylint_django/tests/input/func_noerror_model_unicode_callable.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Ensures that django models without a __unicode__ method are flagged
33
"""
4+
45
# pylint: disable=missing-docstring,wrong-import-position
56

67
from django.db import models

pylint_django/tests/input/func_noerror_model_unicode_lambda.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Ensures that django models without a __unicode__ method are flagged
33
"""
4+
45
# pylint: disable=missing-docstring,wrong-import-position,unnecessary-lambda-assignment
56

67
from django.db import models

pylint_django/tests/input/func_noerror_models_py33.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Checks that Pylint does not complain about a fairly standard
33
Django Model
44
"""
5+
56
# pylint: disable=missing-docstring
67
from django.db import models
78

pylint_django/tests/input/func_noerror_protected_meta_access.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
(see https://github.com/PyCQA/pylint-django/issues/66,
66
and https://docs.djangoproject.com/en/1.9/ref/models/meta/)
77
"""
8+
89
# pylint: disable=missing-docstring
910
from __future__ import print_function
1011

pylint_django/tests/input/func_noerror_string_foreignkey.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Checks that PyLint correctly handles string foreign keys
33
https://github.com/PyCQA/pylint-django/issues/243
44
"""
5+
56
# pylint: disable=missing-docstring, hard-coded-auth-user
67
from django.db import models
78

pylint_django/tests/input/func_noerror_ugettext_lazy_format.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Checks that Pylint does not complain about django lazy proxy
33
when using ugettext_lazy
44
"""
5+
56
from django.utils.translation import ugettext_lazy
67

78
ugettext_lazy("{something}").format(something="lala")

pylint_django/tests/input/func_noerror_unicode_py2_compatible.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
55
See https://github.com/PyCQA/pylint-django/issues/10
66
"""
7+
78
from django.db import models
89

910
# pylint: disable=missing-docstring

pylint_django/tests/input/func_noerror_urls.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Checks that Pylint does not complain about attributes and methods
33
when creating a typical urls.py
44
"""
5+
56
# pylint: disable=missing-docstring
67

78
try:

pylint_django/tests/input/func_noerror_uuid_field.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Checks that Pylint does not complain about UUID fields.
33
"""
4+
45
# pylint: disable=missing-class-docstring,missing-function-docstring
56
from __future__ import print_function
67

pylint_django/tests/input/func_noerror_views.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Checks that Pylint does not complain when using function based views.
33
"""
4+
45
# pylint: disable=missing-docstring
56

67

pylint_django/tests/input/func_unused_arguments.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Checks that Pylint still complains about unused-arguments for other
33
arguments if a function/method contains an argument named `request`.
44
"""
5+
56
# pylint: disable=missing-docstring
67

78
from django.http import JsonResponse

pylint_django/tests/input/migrations/0001_noerror_initial.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Initial migration which should not raise any pylint warnings.
33
"""
4+
45
# pylint: disable=missing-docstring, invalid-name
56
from django.db import migrations, models
67

pylint_django/tests/input/migrations/0002_new_column.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
> For this reason, it’s recommended you always create new columns with
1313
> null=True, as this way they will be added immediately.
1414
"""
15+
1516
# pylint: disable=missing-docstring, invalid-name
1617
from datetime import timedelta
1718

pylint_django/tests/input/models/func_noerror_foreign_key_key_cls_unbound_in_same_package.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
'id' attribute. Also see:
1111
https://github.com/PyCQA/pylint-django/issues/232#issuecomment-495242695
1212
"""
13+
1314
# pylint: disable=missing-docstring, no-member
1415
from django.db import models
1516

pylint_django/transforms/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
For example, the ForeignKeyStringsChecker loads the foreignkey.py transforms
99
itself as it may be disabled independently of the rest of pylint-django
1010
"""
11+
1112
import os
1213
import re
1314

pylint_django/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Utils."""
2+
23
import sys
34

45
import astroid

0 commit comments

Comments
 (0)