diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cc0de3d21..404e2be94 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -21,10 +21,7 @@ repos: hooks: - id: ruff args: ["--fix", "--exit-non-zero-on-fix"] - - repo: https://github.com/psf/black - rev: 24.10.0 - hooks: - - id: black + - id: ruff-format - repo: https://github.com/codespell-project/codespell rev: v2.3.0 hooks: diff --git a/django-stubs/core/handlers/exception.pyi b/django-stubs/core/handlers/exception.pyi index 7edff206a..ea2df1c47 100644 --- a/django-stubs/core/handlers/exception.pyi +++ b/django-stubs/core/handlers/exception.pyi @@ -6,7 +6,7 @@ from django.http.response import HttpResponse, HttpResponseBase from django.urls.resolvers import URLResolver def convert_exception_to_response( - get_response: Callable[[HttpRequest], HttpResponseBase | Awaitable[HttpResponseBase]] + get_response: Callable[[HttpRequest], HttpResponseBase | Awaitable[HttpResponseBase]], ) -> Callable[[HttpRequest], HttpResponseBase | Awaitable[HttpResponseBase]]: ... def response_for_exception(request: HttpRequest, exc: Exception) -> HttpResponse: ... def get_exception_response( diff --git a/django-stubs/db/models/sql/compiler.pyi b/django-stubs/db/models/sql/compiler.pyi index 93a54ac57..6ed8a95ce 100644 --- a/django-stubs/db/models/sql/compiler.pyi +++ b/django-stubs/db/models/sql/compiler.pyi @@ -34,7 +34,10 @@ class SQLCompiler: col_count: int | None def setup_query(self, with_col_aliases: bool = False) -> None: ... has_extra_select: Any - def pre_sql_setup(self, with_col_aliases: bool = False) -> tuple[ + def pre_sql_setup( + self, + with_col_aliases: bool = False, + ) -> tuple[ list[tuple[Expression, _AsSqlType, None]], list[tuple[Expression, tuple[str, _ParamsT, bool]]], list[_AsSqlType], @@ -48,7 +51,8 @@ class SQLCompiler: self, expressions: list[Expression], having: list[Expression] | tuple ) -> list[Expression]: ... def get_select( - self, with_col_aliases: bool = False + self, + with_col_aliases: bool = False, ) -> tuple[list[tuple[Expression, _AsSqlType, str | None]], dict[str, Any] | None, dict[str, int]]: ... def _order_by_pairs(self) -> None: ... def get_order_by(self) -> list[tuple[Expression, tuple[str, _ParamsT, bool]]]: ... diff --git a/django-stubs/utils/html.pyi b/django-stubs/utils/html.pyi index b72f961f0..c5ce522e5 100644 --- a/django-stubs/utils/html.pyi +++ b/django-stubs/utils/html.pyi @@ -11,6 +11,7 @@ from django.utils.safestring import SafeData, SafeString VOID_ELEMENTS: frozenset[str] MAX_URL_LENGTH: int +MAX_STRIP_TAGS_DEPTH: int def escape(text: Any) -> SafeString: ... def escapejs(value: Any) -> SafeString: ... diff --git a/pyproject.toml b/pyproject.toml index a8fccfbc4..c278234aa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,21 +1,10 @@ -[tool.black] -target-version = ['py38'] -line-length = 120 -include = '\.pyi?$' - [tool.codespell] ignore-words-list = "aadd,acount,nam,asend" [tool.ruff] # Adds to default excludes: https://ruff.rs/docs/settings/#exclude -extend-exclude = [ - ".*/", - "django-source", - "stubgen", - "out", -] line-length = 120 -target-version = "py38" +target-version = "py39" [tool.ruff.lint] # See Rules in Ruff documentation: https://beta.ruff.rs/docs/rules/ diff --git a/requirements.txt b/requirements.txt index c3b74cfba..4261b664b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,5 @@ # Dev tools: -black==24.8.0 -pre-commit==3.5.0; python_version < '3.9' -pre-commit==4.0.1; python_version >= '3.9' +pre-commit==4.0.1 pytest==8.3.4 pytest-mypy-plugins==3.1.2 pytest-shard==0.1.2