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

CI: Auto-remove unused imports using Ruff #424

Merged
merged 3 commits into from
Jun 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ repos:
rev: v0.0.270
hooks:
- id: ruff
args: ["--fix", "--fixable=I001", "--exit-non-zero-on-fix"]
args: ["--fix", "--exit-non-zero-on-fix"]
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ line-length = 120
target-version = "py38"
select = [
"I", # isort
"F401", # Unused imports
]

[tool.ruff.isort]
Expand Down
4 changes: 0 additions & 4 deletions rest_framework-stubs/serializers.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@ from collections.abc import Callable, Iterable, Iterator, Mapping, MutableMappin
from typing import Any, Generic, NoReturn, TypeVar

from _typeshed import Self
from django.core.exceptions import ValidationError as DjangoValidationError
from django.db import models
from django.db.models import DurationField as ModelDurationField
from django.db.models import Manager, Model, QuerySet
from django.db.models.fields import Field as DjangoModelField
from django.utils.functional import cached_property
from django.utils.translation import ugettext_lazy as _
from django_stubs_ext import StrOrPromise
from rest_framework.exceptions import APIException as APIException
from rest_framework.exceptions import AuthenticationFailed as AuthenticationFailed
Expand Down