Skip to content
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

[pre-commit.ci] pre-commit autoupdate #419

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@ ci:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: mixed-line-ending
args: [--fix=lf]
- id: debug-statements
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.1.4"
rev: "v0.4.5"
hooks:
- id: ruff
args: ["--fix"]
exclude: "tests/input/"
- repo: https://github.com/psf/black
rev: 23.10.1
rev: 24.4.2
hooks:
- id: black
args: [--safe, --line-length=120]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.3
rev: v4.0.0-alpha.8
hooks:
- id: prettier
args: [--prose-wrap=always, --print-width=88]
Expand Down
1 change: 0 additions & 1 deletion pylint_django/__init__.py
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
"""pkginfo."""

BASE_ID = 51
1 change: 1 addition & 0 deletions pylint_django/augmentations/__init__.py
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Checks that Pylint does not complain Postgres model fields.
"""

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

Expand Down
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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")
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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")
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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