Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Apr 8, 2024
1 parent 256e195 commit 9ec57a8
Show file tree
Hide file tree
Showing 50 changed files with 49 additions and 1 deletion.
1 change: 0 additions & 1 deletion pylint_django/__init__.py
@@ -1,6 +1,5 @@
"""pylint_django module."""


from pylint_django import plugin

register = plugin.register # pylint: disable=invalid-name
Expand Down
1 change: 1 addition & 0 deletions pylint_django/__pkginfo__.py
@@ -1,2 +1,3 @@
"""pkginfo."""

BASE_ID = 51
1 change: 1 addition & 0 deletions pylint_django/augmentations/__init__.py
@@ -1,4 +1,5 @@
"""Augmentations."""

# pylint: disable=invalid-name
import functools
import itertools
Expand Down
1 change: 1 addition & 0 deletions pylint_django/checkers/__init__.py
@@ -1,4 +1,5 @@
"""Checkers."""

from pylint_django.checkers.auth_user import AuthUserChecker
from pylint_django.checkers.django_installed import DjangoInstalledChecker
from pylint_django.checkers.foreign_key_strings import ForeignKeyStringsChecker
Expand Down
1 change: 1 addition & 0 deletions pylint_django/checkers/forms.py
@@ -1,4 +1,5 @@
"""Models."""

from astroid.nodes import Assign, AssignName, ClassDef
from pylint.checkers import BaseChecker

Expand Down
1 change: 1 addition & 0 deletions pylint_django/checkers/models.py
@@ -1,4 +1,5 @@
"""Models."""

from astroid import Const
from astroid.nodes import Assign, AssignName, ClassDef, FunctionDef
from pylint.checkers import BaseChecker
Expand Down
1 change: 1 addition & 0 deletions pylint_django/plugin.py
@@ -1,4 +1,5 @@
"""Common Django module."""

# we want to import the transforms to make sure they get added to the astroid manager,
# however we don't actually access them directly, so we'll disable the warning
from pylint_django import compat
Expand Down
@@ -1,6 +1,7 @@
"""
Checks that Pylint does not complain about DRF serializers
"""

# pylint: disable=C0111,W5101,use-symbolic-message-instead

from rest_framework import serializers
Expand Down
1 change: 1 addition & 0 deletions pylint_django/tests/input/external_factory_boy_noerror.py
Expand Up @@ -2,6 +2,7 @@
Test to validate that pylint_django doesn't produce
Instance of 'SubFactory' has no 'pk' member (no-member) warnings
"""

# pylint: disable=attribute-defined-outside-init, missing-docstring, too-few-public-methods
import factory
from django import test
Expand Down
@@ -1,6 +1,7 @@
"""
Checks that Pylint does not complain Postgres model fields.
"""

# pylint: disable=C0111,W5101
from __future__ import print_function

Expand Down
Expand Up @@ -9,6 +9,7 @@
The issue is the lint trys resolving the `ForeignKey` for the
tastypie `ForeignKey` which cause import error.
"""

from tastypie import fields
from tastypie.fields import ForeignKey

Expand Down
@@ -1,6 +1,7 @@
"""
Ensures that under PY3 django models with a __unicode__ method are flagged
"""

# pylint: disable=missing-docstring

from django.db import models
Expand Down
Expand Up @@ -3,6 +3,7 @@
python_2_unicode_compatible decorator applied are flagged correctly as not
having explicitly defined __unicode__
"""

# pylint: disable=missing-docstring

from django.db import models
Expand Down
1 change: 1 addition & 0 deletions pylint_django/tests/input/func_modelform_exclude.py
@@ -1,6 +1,7 @@
"""
Checks that Pylint complains about ModelForm using exclude
"""

# pylint: disable=missing-docstring
from django import forms

Expand Down
1 change: 1 addition & 0 deletions pylint_django/tests/input/func_noerror_classviews.py
Expand Up @@ -2,6 +2,7 @@
Checks that Pylint does not complain about attributes and methods
when using Class-based Views
"""

# pylint: disable=missing-docstring

from django.db import models
Expand Down
Expand Up @@ -3,6 +3,7 @@
except blocks catching DoesNotExist exceptions:
https://github.com/PyCQA/pylint-django/issues/81
"""

# pylint: disable=missing-docstring
from django.db import models

Expand Down
Expand Up @@ -2,6 +2,7 @@
Checks that Pylint does not complain about no self argument in
factory.post_generation method.
"""

# pylint: disable=missing-docstring,too-few-public-methods,unused-argument,no-member
import factory

Expand Down
@@ -1,6 +1,7 @@
"""
Checks that Pylint does not complain about foreign key sets on models
"""

# pylint: disable=missing-docstring consider-using-f-string

from django.db import models
Expand Down
1 change: 1 addition & 0 deletions pylint_django/tests/input/func_noerror_foreign_key_ids.py
@@ -1,6 +1,7 @@
"""
Checks that Pylint does not complain about foreign key id access
"""

# pylint: disable=missing-docstring,wrong-import-position
from django.db import models

Expand Down
Expand Up @@ -2,6 +2,7 @@
Checks that Pylint does not complain about ForeignKey pointing to model
in module of models package
"""

# pylint: disable=missing-docstring
from django.db import models

Expand Down
Expand Up @@ -2,6 +2,7 @@
Checks that Pylint does not complain about ForeignKey pointing to model
in module of models package
"""

# pylint: disable=missing-docstring
from django.db import models

Expand Down
1 change: 1 addition & 0 deletions pylint_django/tests/input/func_noerror_foreign_key_sets.py
@@ -1,6 +1,7 @@
"""
Checks that Pylint does not complain about foreign key sets on models
"""

# pylint: disable=missing-docstring

from django.db import models
Expand Down
1 change: 1 addition & 0 deletions pylint_django/tests/input/func_noerror_foreignkeys.py
Expand Up @@ -2,6 +2,7 @@
Checks that Pylint does not complain about various
methods on Django model fields.
"""

# pylint: disable=missing-docstring,wrong-import-position
from django.db import models
from django.db.models import ForeignKey, OneToOneField
Expand Down
1 change: 1 addition & 0 deletions pylint_django/tests/input/func_noerror_form_fields.py
Expand Up @@ -2,6 +2,7 @@
Checks that Pylint does not complain about various
methods on Django form forms.
"""

# pylint: disable=missing-docstring
from __future__ import print_function

Expand Down
1 change: 1 addition & 0 deletions pylint_django/tests/input/func_noerror_forms_py33.py
@@ -1,6 +1,7 @@
"""
Checks that Pylint does not complain about django Forms
"""

# pylint: disable=missing-docstring,wrong-import-position

from django import forms
Expand Down
Expand Up @@ -2,6 +2,7 @@
Checks that Pylint does not complain about django FormViews
having too many ancestors
"""

# pylint: disable=missing-docstring
from django.views.generic import FormView

Expand Down
Expand Up @@ -2,6 +2,7 @@
Checks that Pylint does not complain about GenericForeignKey fields:
https://github.com/PyCQA/pylint-django/issues/230
"""

# pylint: disable=missing-docstring

from django.contrib.contenttypes.fields import GenericForeignKey
Expand Down
Expand Up @@ -2,6 +2,7 @@
Checks that Pylint does not complain about django lazy proxy
when using gettext_lazy
"""

from django.utils.translation import gettext_lazy

gettext_lazy("{something}").format(something="lala")
Expand Up @@ -2,6 +2,7 @@
This test ensures that a 'Meta' class defined on a Django model does
not raise warnings such as 'old-style-class' and 'too-few-public-methods'
"""

# pylint: disable=missing-docstring

from django.db import models
Expand Down
1 change: 1 addition & 0 deletions pylint_django/tests/input/func_noerror_import_q.py
@@ -1,5 +1,6 @@
"""
Checks that Pylint does not complain about import of Q.
"""

# pylint: disable=missing-docstring,unused-import
from django.db.models import Q # noqa: F401
1 change: 1 addition & 0 deletions pylint_django/tests/input/func_noerror_issue_46.py
@@ -1,6 +1,7 @@
"""
Checks that Pylint does not complain about raising DoesNotExist
"""

# pylint: disable=missing-docstring
from django.db import models

Expand Down
1 change: 1 addition & 0 deletions pylint_django/tests/input/func_noerror_manytomanyfield.py
Expand Up @@ -2,6 +2,7 @@
Checks that Pylint does not complain about various
methods on many-to-many relationships
"""

from django.contrib.auth.models import AbstractUser, Permission

# pylint: disable=missing-docstring
Expand Down
1 change: 1 addition & 0 deletions pylint_django/tests/input/func_noerror_model_fields.py
Expand Up @@ -2,6 +2,7 @@
Checks that Pylint does not complain about various
methods on Django model fields.
"""

# pylint: disable=missing-docstring
from __future__ import print_function

Expand Down
1 change: 1 addition & 0 deletions pylint_django/tests/input/func_noerror_model_methods.py
@@ -1,6 +1,7 @@
"""
Checks that Pylint does not complain about using Model and Manager methods
"""

# pylint: disable=missing-docstring
from django.db import models

Expand Down
@@ -1,6 +1,7 @@
"""
Ensures that django models without a __unicode__ method are flagged
"""

# pylint: disable=missing-docstring,wrong-import-position

from django.db import models
Expand Down
@@ -1,6 +1,7 @@
"""
Ensures that django models without a __unicode__ method are flagged
"""

# pylint: disable=missing-docstring,wrong-import-position,unnecessary-lambda-assignment

from django.db import models
Expand Down
1 change: 1 addition & 0 deletions pylint_django/tests/input/func_noerror_models_py33.py
Expand Up @@ -2,6 +2,7 @@
Checks that Pylint does not complain about a fairly standard
Django Model
"""

# pylint: disable=missing-docstring
from django.db import models

Expand Down
Expand Up @@ -5,6 +5,7 @@
(see https://github.com/PyCQA/pylint-django/issues/66,
and https://docs.djangoproject.com/en/1.9/ref/models/meta/)
"""

# pylint: disable=missing-docstring
from __future__ import print_function

Expand Down
Expand Up @@ -2,6 +2,7 @@
Checks that PyLint correctly handles string foreign keys
https://github.com/PyCQA/pylint-django/issues/243
"""

# pylint: disable=missing-docstring, hard-coded-auth-user
from django.db import models

Expand Down
Expand Up @@ -2,6 +2,7 @@
Checks that Pylint does not complain about django lazy proxy
when using ugettext_lazy
"""

from django.utils.translation import ugettext_lazy

ugettext_lazy("{something}").format(something="lala")
Expand Up @@ -4,6 +4,7 @@
See https://github.com/PyCQA/pylint-django/issues/10
"""

from django.db import models

# pylint: disable=missing-docstring
Expand Down
1 change: 1 addition & 0 deletions pylint_django/tests/input/func_noerror_urls.py
Expand Up @@ -2,6 +2,7 @@
Checks that Pylint does not complain about attributes and methods
when creating a typical urls.py
"""

# pylint: disable=missing-docstring

try:
Expand Down
1 change: 1 addition & 0 deletions pylint_django/tests/input/func_noerror_uuid_field.py
@@ -1,6 +1,7 @@
"""
Checks that Pylint does not complain about UUID fields.
"""

# pylint: disable=missing-class-docstring,missing-function-docstring
from __future__ import print_function

Expand Down
1 change: 1 addition & 0 deletions pylint_django/tests/input/func_noerror_views.py
@@ -1,6 +1,7 @@
"""
Checks that Pylint does not complain when using function based views.
"""

# pylint: disable=missing-docstring


Expand Down
1 change: 1 addition & 0 deletions pylint_django/tests/input/func_unused_arguments.py
Expand Up @@ -2,6 +2,7 @@
Checks that Pylint still complains about unused-arguments for other
arguments if a function/method contains an argument named `request`.
"""

# pylint: disable=missing-docstring

from django.http import JsonResponse
Expand Down
@@ -1,6 +1,7 @@
"""
Initial migration which should not raise any pylint warnings.
"""

# pylint: disable=missing-docstring, invalid-name
from django.db import migrations, models

Expand Down
1 change: 1 addition & 0 deletions pylint_django/tests/input/migrations/0002_new_column.py
Expand Up @@ -12,6 +12,7 @@
> For this reason, it’s recommended you always create new columns with
> null=True, as this way they will be added immediately.
"""

# pylint: disable=missing-docstring, invalid-name
from datetime import timedelta

Expand Down
Expand Up @@ -10,6 +10,7 @@
'id' attribute. Also see:
https://github.com/PyCQA/pylint-django/issues/232#issuecomment-495242695
"""

# pylint: disable=missing-docstring, no-member
from django.db import models

Expand Down
1 change: 1 addition & 0 deletions pylint_django/transforms/__init__.py
Expand Up @@ -8,6 +8,7 @@
For example, the ForeignKeyStringsChecker loads the foreignkey.py transforms
itself as it may be disabled independently of the rest of pylint-django
"""

import os
import re

Expand Down
1 change: 1 addition & 0 deletions pylint_django/utils.py
@@ -1,4 +1,5 @@
"""Utils."""

import sys

import astroid
Expand Down

0 comments on commit 9ec57a8

Please sign in to comment.