Skip to content

Commit

Permalink
Add isort config to format imports like it
Browse files Browse the repository at this point in the history
  • Loading branch information
le717 committed Jun 8, 2024
1 parent ef2cae8 commit 80fdd55
Show file tree
Hide file tree
Showing 22 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions db/dummy_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import sys_vars
from flask import Flask


# We have to add the app path to the path to get the db schema
sys.path.insert(0, Path(__file__).parent.parent.as_posix())

Expand Down
1 change: 1 addition & 0 deletions db/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from src.app_factory import create_app


# There's no access to current_app here so we must create our own app.
app = create_app()
db_uri = app.config["SQLALCHEMY_DATABASE_URI"]
Expand Down
1 change: 1 addition & 0 deletions db/versions/7e3df200a38d_remove_rotted_column.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import sqlalchemy as sa
from alembic import op


# revision identifiers, used by Alembic.
revision = "7e3df200a38d"
down_revision = "c41abb284c8f"
Expand Down
1 change: 1 addition & 0 deletions db/versions/c41abb284c8f_add_is_dead_is_web_archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import sqlalchemy as sa
from alembic import op


# revision identifiers, used by Alembic.
revision = "c41abb284c8f"
down_revision = None
Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,7 @@ quote-style = "double"

[tool.ruff.lint.mccabe]
max-complexity = 10

[tool.ruff.lint.isort]
lines-after-imports = 2
extra-standard-library = ["zoneinfo"]
2 changes: 2 additions & 0 deletions scripts/make_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
from alembic.config import Config
from sqlalchemy import inspect


# We have to add the app path to the path to get the db
sys.path.insert(0, Path(__file__).parent.parent.as_posix())


from db.dummy_db import create_app
from src.core.database.schema import Base, db


__all__ = ["create_database"]


Expand Down
1 change: 1 addition & 0 deletions src/blueprints.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from flask import Blueprint as FlBlueprint
from flask_smorest import Blueprint


__all__ = ["all_blueprints", "route_embed"]


Expand Down
1 change: 1 addition & 0 deletions src/core/database/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from src.core.database import linkrot, schema, weblink


__all__ = ["linkrot", "schema", "weblink"]
1 change: 1 addition & 0 deletions src/core/database/linkrot.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from src.core.database.schema import RottedLinks, WebLink, db
from src.core.logger import logger


__all__ = ["check_all", "check_one", "delete"]


Expand Down
1 change: 1 addition & 0 deletions src/core/database/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column
from sqlalchemy.types import String


__all__ = ["Base", "RottedLinks", "WebLink"]


Expand Down
1 change: 1 addition & 0 deletions src/core/database/weblink.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from src.core.database.schema import WebLink, db
from src.core.logger import logger


__all__ = ["create", "delete", "exists", "get", "get_all", "update"]


Expand Down
1 change: 1 addition & 0 deletions src/core/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import sys_vars
from flask import request


__all__ = ["logger", "DiscordHandler", "file_handler"]


Expand Down
1 change: 1 addition & 0 deletions src/core/models/AuthKey.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import sys_vars
from marshmallow import Schema, fields


AUTH_KEYS = sys_vars.get_json("AUTH_KEYS")


Expand Down
1 change: 1 addition & 0 deletions src/core/models/Empty.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from marshmallow import Schema


__all__ = ["Empty"]


Expand Down
1 change: 1 addition & 0 deletions src/core/models/HttpError.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from marshmallow import Schema, fields


__all__ = ["HttpError"]


Expand Down
1 change: 1 addition & 0 deletions src/core/models/RotResult.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from marshmallow import Schema, fields


__all__ = ["RotResult"]


Expand Down
1 change: 1 addition & 0 deletions src/core/models/WebLink.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from marshmallow import Schema, fields


__all__ = ["WebLink", "WebLinkCreate", "WebLinkGet", "WebLinkId", "WebLinkUpdate"]


Expand Down
1 change: 1 addition & 0 deletions src/core/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
from .RotResult import *
from .WebLink import *


__all__ = ["Empty", "HttpError"]
1 change: 1 addition & 0 deletions src/views/embed.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from ..blueprints import route_embed


__all__ = ["embed"]


Expand Down
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import pytest


os.environ["SYS_VARS_PATH"] = (Path.cwd() / "tests" / "secrets").as_posix()

from alembic import command
Expand Down
1 change: 1 addition & 0 deletions tests/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from typing import Any
from urllib.parse import urlencode


__all__ = [
"INVALID_AUTH",
"VALID_AUTH",
Expand Down
1 change: 1 addition & 0 deletions wsgi.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from src.app_factory import create_app


app = create_app()

if __name__ == "__main__":
Expand Down

0 comments on commit 80fdd55

Please sign in to comment.