Add isort force-sort-within-sections

This commit is contained in:
2023-01-09 21:32:30 +01:00
parent 1f18897dc3
commit 966765a532
6 changed files with 7 additions and 6 deletions

View File

@@ -8,7 +8,7 @@ repos:
language_version: python3.11
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.0.213'
rev: 'v0.0.216'
hooks:
- id: ruff
args: ["--force-exclude"]

View File

@@ -64,6 +64,7 @@ max-complexity = 15
[tool.ruff.isort]
known-first-party = ["core", "app"]
force-sort-within-sections = true
# only_sections = true
# force_sort_within_sections = true

View File

@@ -1,14 +1,14 @@
import collections
from datetime import timedelta
import logging
import random
from datetime import timedelta
from tempfile import SpooledTemporaryFile
from typing import Optional, cast
import httpx
from arq.connections import ArqRedis
from arq.worker import Retry
from fastapi import UploadFile
import httpx
from redis import asyncio as aioredis
from redis.exceptions import LockError

View File

@@ -2,11 +2,11 @@ from fastapi import FastAPI
from fastapi.responses import ORJSONResponse
from prometheus_fastapi_instrumentator import Instrumentator
import core.sentry # noqa: F401
from app.views import healthcheck_router, router
from core.arq_pool import get_arq_pool
from core.db import database
from core.redis_client import get_client
import core.sentry # noqa: F401
def start_app() -> FastAPI:

View File

@@ -1,5 +1,5 @@
import msgpack
from arq.connections import ArqRedis, RedisSettings, create_pool
import msgpack
from core.config import env_config

View File

@@ -1,6 +1,5 @@
import msgpack
import core.sentry # noqa: F401
from app.services.cache_updater import (
cache_file_by_book_id,
check_books,
@@ -9,6 +8,7 @@ from app.services.cache_updater import (
from core.arq_pool import get_arq_pool, get_redis_settings
from core.db import database
from core.redis_client import get_client
import core.sentry # noqa: F401
async def startup(ctx):