diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0860149..ff352ef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,8 +52,12 @@ jobs: - name: Run tests run: python -m pytest -v - - name: Generate coverage report - run: python -m pytest --cov=app --cov-report=term-missing + - name: Lint with Ruff + run: ruff check . + + - name: Run tests with coverage gate + run: python -m pytest --cov=app --cov-report=term-missing --cov-fail-under=80 + publish: if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') diff --git a/alembic/env.py b/alembic/env.py index e27b8d7..8b817c8 100644 --- a/alembic/env.py +++ b/alembic/env.py @@ -40,8 +40,6 @@ # target_metadata = None # replacing with the actual metadata from models from app.db.base import Base -from app.models.user import User -from app.models.task import Task target_metadata = Base.metadata diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..2bebdde --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,2 @@ +[tool.ruff.lint.per-file-ignores] +"alembic/env.py" = ["E402", "F401"] \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index c72d4a8..8b9fa60 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,4 +9,5 @@ email-validator alembic pytest-cov pytest -httpx \ No newline at end of file +httpx +Ruff \ No newline at end of file diff --git a/tests/test_tasks.py b/tests/test_tasks.py index 3a4d009..dd06af5 100644 --- a/tests/test_tasks.py +++ b/tests/test_tasks.py @@ -1,4 +1,3 @@ -import pytest def create_user(client): response = client.post( diff --git a/tests/test_users.py b/tests/test_users.py index 4421cd1..d390cc9 100644 --- a/tests/test_users.py +++ b/tests/test_users.py @@ -1,4 +1,3 @@ -import pytest def test_create_user(client):