From ff0e3ab72e2a8a9457d6f07f48a912c2a30ec732 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20K=C3=A4ufl?= Date: Wed, 28 Feb 2024 22:11:46 +0100 Subject: [PATCH] Fix issues found by ruff --- .../tests/input/external_psycopg2_noerror_postgres_fields.py | 1 - pylint_django/tests/input/func_hard_coded_auth_user.py | 4 +--- pylint_django/tests/input/func_noerror_form_fields.py | 1 - pylint_django/tests/input/func_noerror_model_fields.py | 1 - .../tests/input/func_noerror_protected_meta_access.py | 1 - pylint_django/tests/input/func_noerror_uuid_field.py | 1 - pylint_django/tests/input/migrations/0002_new_column.py | 2 +- pyproject.toml | 2 ++ 8 files changed, 4 insertions(+), 9 deletions(-) diff --git a/pylint_django/tests/input/external_psycopg2_noerror_postgres_fields.py b/pylint_django/tests/input/external_psycopg2_noerror_postgres_fields.py index 043126b0..b625de59 100644 --- a/pylint_django/tests/input/external_psycopg2_noerror_postgres_fields.py +++ b/pylint_django/tests/input/external_psycopg2_noerror_postgres_fields.py @@ -2,7 +2,6 @@ Checks that Pylint does not complain Postgres model fields. """ # pylint: disable=C0111,W5101 -from __future__ import print_function from django.contrib.postgres import fields from django.db import models diff --git a/pylint_django/tests/input/func_hard_coded_auth_user.py b/pylint_django/tests/input/func_hard_coded_auth_user.py index 99e3041b..c3c37cf1 100644 --- a/pylint_django/tests/input/func_hard_coded_auth_user.py +++ b/pylint_django/tests/input/func_hard_coded_auth_user.py @@ -1,8 +1,6 @@ # pylint: disable=missing-docstring, wildcard-import, unused-wildcard-import -# flake8: noqa=F401, F403 -from django.contrib.auth.models import * # [imported-auth-user] -from django.contrib.auth.models import User # [imported-auth-user] +from django.contrib.auth.models import * # [imported-auth-user] # noqa: F403 from django.db import models diff --git a/pylint_django/tests/input/func_noerror_form_fields.py b/pylint_django/tests/input/func_noerror_form_fields.py index dada077b..61fd7f84 100644 --- a/pylint_django/tests/input/func_noerror_form_fields.py +++ b/pylint_django/tests/input/func_noerror_form_fields.py @@ -3,7 +3,6 @@ methods on Django form forms. """ # pylint: disable=missing-docstring -from __future__ import print_function from datetime import date, datetime diff --git a/pylint_django/tests/input/func_noerror_model_fields.py b/pylint_django/tests/input/func_noerror_model_fields.py index c0389ff7..b254003b 100644 --- a/pylint_django/tests/input/func_noerror_model_fields.py +++ b/pylint_django/tests/input/func_noerror_model_fields.py @@ -3,7 +3,6 @@ methods on Django model fields. """ # pylint: disable=missing-docstring -from __future__ import print_function from datetime import date, datetime from decimal import Decimal diff --git a/pylint_django/tests/input/func_noerror_protected_meta_access.py b/pylint_django/tests/input/func_noerror_protected_meta_access.py index 96e09adc..3671af58 100644 --- a/pylint_django/tests/input/func_noerror_protected_meta_access.py +++ b/pylint_django/tests/input/func_noerror_protected_meta_access.py @@ -6,7 +6,6 @@ and https://docs.djangoproject.com/en/1.9/ref/models/meta/) """ # pylint: disable=missing-docstring -from __future__ import print_function from django.db import models diff --git a/pylint_django/tests/input/func_noerror_uuid_field.py b/pylint_django/tests/input/func_noerror_uuid_field.py index 0d38dfc9..da5b3c6c 100644 --- a/pylint_django/tests/input/func_noerror_uuid_field.py +++ b/pylint_django/tests/input/func_noerror_uuid_field.py @@ -2,7 +2,6 @@ Checks that Pylint does not complain about UUID fields. """ # pylint: disable=missing-class-docstring,missing-function-docstring -from __future__ import print_function from django.db import models diff --git a/pylint_django/tests/input/migrations/0002_new_column.py b/pylint_django/tests/input/migrations/0002_new_column.py index 07ebc2d6..e3df2ed9 100644 --- a/pylint_django/tests/input/migrations/0002_new_column.py +++ b/pylint_django/tests/input/migrations/0002_new_column.py @@ -9,7 +9,7 @@ > ... adding columns with default values will cause a full rewrite of > the table, for a time proportional to its size. -> For this reason, it’s recommended you always create new columns with +> 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 diff --git a/pyproject.toml b/pyproject.toml index 41362e51..8a2b63ad 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -86,6 +86,8 @@ max-line-length = 120 [tool.ruff] line-length = 120 + +[tool.ruff.lint] select = [ "E", # pycodestyle "F", # pyflakes