From 21cc3417e1434baa3920f72ace8f599f2c7eca10 Mon Sep 17 00:00:00 2001 From: Jakub Kriz Date: Sat, 21 Sep 2024 09:26:18 +0200 Subject: [PATCH] fix: mypy in pre-commit --- .pre-commit-config.yaml | 40 +++++++++++++++++++++++----------------- run_app.py | 2 +- shortener/__init__.py | 0 3 files changed, 24 insertions(+), 18 deletions(-) create mode 100644 shortener/__init__.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e66da53..5af2ea1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,20 @@ default_language_version: python: python3.12 repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.6.0 + hooks: + - id: check-yaml + - id: debug-statements + - id: check-ast + - id: check-executables-have-shebangs + - id: check-shebang-scripts-are-executable + - id: check-merge-conflict + - id: trailing-whitespace + - id: end-of-file-fixer + - id: fix-encoding-pragma + args: [--remove] + - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.5.0 hooks: @@ -11,25 +25,17 @@ repos: rev: v1.10.1 hooks: - id: mypy - args: [--explicit-package-bases, --namespace-packages, --ignore-missing-imports] - exclude: "upload_test_coverage.py" + exclude: ^tests/ + args: [] + additional_dependencies: + - pydantic + - pydantic-settings + - asyncpg + - asyncpg-stubs + - starlette + - uvicorn - repo: https://github.com/jazzband/pip-tools rev: 7.4.1 hooks: - id: pip-compile - - -- repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 - hooks: - - id: check-yaml - - id: debug-statements - - id: check-ast - - id: check-executables-have-shebangs - - id: check-shebang-scripts-are-executable - - id: check-merge-conflict - - id: trailing-whitespace - - id: end-of-file-fixer - - id: fix-encoding-pragma - args: [--remove] diff --git a/run_app.py b/run_app.py index 912c424..6665b2c 100644 --- a/run_app.py +++ b/run_app.py @@ -6,4 +6,4 @@ if __name__ == "__main__": port = os.getenv("APPLICATION_PORT", 8000) - uvicorn.run(app, host="127.0.0.0", port=port, loop="uvloop") + uvicorn.run(app, host="127.0.0.0", port=int(port), loop="uvloop") diff --git a/shortener/__init__.py b/shortener/__init__.py new file mode 100644 index 0000000..e69de29