Skip to content

Commit

Permalink
Fix code styling
Browse files Browse the repository at this point in the history
  • Loading branch information
bkis committed Mar 1, 2024
1 parent 59ee89d commit 553dc24
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 19 deletions.
18 changes: 9 additions & 9 deletions Tekst-API/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,25 +53,25 @@ line-length = 88
indent-width = 4
respect-gitignore = false
src = ["tekst", "tests"]

[tool.ruff.lint]
fixable = ["ALL"]
unfixable = []


ignore = ["F722"]
select = ["E", "F", "W", "I", "UP", "SIM"]

[tool.ruff.format]
quote-style = "double"
indent-style = "space"
line-ending = "lf"
skip-magic-trailing-comma = false
[tool.ruff.lint.pep8-naming]
classmethod-decorators = ["classmethod", "pydantic.validator"]

[tool.ruff.lint.isort]
lines-after-imports = 2
lines-between-types = 1

[tool.ruff.pep8-naming]
classmethod-decorators = ["classmethod", "pydantic.validator"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
line-ending = "lf"
skip-magic-trailing-comma = false

[tool.pytest.ini_options]
testpaths = ["tests"]
Expand Down
2 changes: 1 addition & 1 deletion Tekst-API/tekst/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from tekst.auth import AccessToken
from tekst.config import TekstConfig, get_config
from tekst.locks import LocksStatus
from tekst.logging import log
from tekst.models.bookmark import BookmarkDocument
from tekst.models.content import ContentBaseDocument
Expand All @@ -14,7 +15,6 @@
from tekst.models.text import TextDocument
from tekst.models.user import UserDocument
from tekst.resources import resource_types_mgr
from tekst.locks import LocksStatus


_db_client: DatabaseClient = None
Expand Down
4 changes: 3 additions & 1 deletion Tekst-API/tekst/locks.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from enum import Enum
from tekst.models.common import PlatformStateDocumentBase

from humps import dekebabize

from tekst.models.common import PlatformStateDocumentBase


class LockKey(Enum):
INDEX_CREATE_UPDATE = "index-create-update"
Expand Down
2 changes: 1 addition & 1 deletion Tekst-API/tekst/models/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
from tekst.config import TekstConfig, get_config
from tekst.models.common import (
CustomHttpUrl,
PlatformStateDocumentBase,
LocaleKey,
ModelBase,
ModelFactoryMixin,
PlatformStateDocumentBase,
TranslationBase,
Translations,
)
Expand Down
7 changes: 4 additions & 3 deletions Tekst-API/tekst/routers/admin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from fastapi import APIRouter, BackgroundTasks, status, Path
from typing import Annotated
from tekst import errors, search

from fastapi import APIRouter, BackgroundTasks, Path, status

from tekst import errors, locks, search
from tekst.auth import SuperuserDep
from tekst.models.location import LocationDocument
from tekst.models.platform import PlatformStats, TextStats
Expand All @@ -9,7 +11,6 @@
from tekst.models.user import UserDocument, UserRead
from tekst.resources import resource_types_mgr
from tekst.search.responses import IndexInfoResponse
from tekst import locks


router = APIRouter(
Expand Down
3 changes: 1 addition & 2 deletions Tekst-API/tekst/routers/texts.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from fastapi.responses import FileResponse
from starlette.background import BackgroundTask

from tekst import errors
from tekst import errors, locks
from tekst.auth import OptionalUserDep, SuperuserDep
from tekst.logging import log
from tekst.models.common import Translations
Expand All @@ -33,7 +33,6 @@
)
from tekst.settings import get_settings
from tekst.utils import get_temp_dir
from tekst import locks


router = APIRouter(
Expand Down
4 changes: 2 additions & 2 deletions Tekst-API/tekst/search/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
from beanie.operators import Eq
from elasticsearch import Elasticsearch

from tekst import locks
from tekst.config import TekstConfig, get_config
from tekst.logging import log
from tekst.models.content import ContentBaseDocument
from tekst.models.location import LocationDocument
from tekst.models.resource import ResourceBaseDocument
from tekst.resources import resource_types_mgr
from tekst.search.template import INDEX_TEMPLATE
from tekst.search.responses import IndexInfoResponse
from tekst import locks
from tekst.search.template import INDEX_TEMPLATE


_cfg: TekstConfig = get_config()
Expand Down

0 comments on commit 553dc24

Please sign in to comment.