Skip to content

Commit

Permalink
Merge pull request #142 from booxter/remove-ruff
Browse files Browse the repository at this point in the history
Consolidate ruff and mypy checks
  • Loading branch information
booxter authored Nov 22, 2024
2 parents 5d3e2aa + 6c62b1c commit 3a08b3f
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 39 deletions.
18 changes: 0 additions & 18 deletions .github/workflows/mypy.yml

This file was deleted.

8 changes: 0 additions & 8 deletions .github/workflows/ruff.yml

This file was deleted.

6 changes: 5 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -17,6 +17,10 @@ repos:
args: [ --fix ]
# Run the formatter.
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.13.0'
hooks:
- id: mypy
- repo: local
hooks:
- id: shellcheck
Expand Down
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,14 @@ DIRECTORS_FILE?=directors.csv
RUN_LOG?=run.log
RUN_LOG_CMD?=ts | tee -a $(RUN_LOG)

.PHONY: install lint mypy test populate run-update-directors run-update-films run-update-offers run-cleanup run-all run-db-upgrade webapp ui swagger swagger-py swagger-js swagger-ts swagger-all get-dirs get-films
.PHONY: install lint test populate run-update-directors run-update-films run-update-offers run-cleanup run-all run-db-upgrade webapp ui swagger swagger-py swagger-js swagger-ts swagger-all get-dirs get-films

install:
pdm install -vd

lint: install swagger
pre-commit run --all-files

mypy:
pdm run mypy .

test: lint
pdm run pytest

Expand Down
3 changes: 2 additions & 1 deletion alembic/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
from sqlalchemy import engine_from_config
from sqlalchemy import pool

from alembic import context
# TODO: Fix type ignore by moving alembic/ directory?
from alembic import context # type: ignore[attr-defined]

from letsrolld import db
from letsrolld.db import models
Expand Down
3 changes: 2 additions & 1 deletion alembic/versions/6583b50e5924_initial_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

from typing import Sequence, Union

from alembic import op
# TODO: Fix type ignore by moving alembic/ directory?
from alembic import op # type: ignore[attr-defined]
import sqlalchemy as sa


Expand Down
12 changes: 6 additions & 6 deletions src/letsrolld/db/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
)


class Genre(Base):
class Genre(Base): # type: ignore[valid-type,misc]
__tablename__ = "genres"

id = Column(Integer, primary_key=True)
Expand All @@ -29,14 +29,14 @@ class Genre(Base):
)


class Country(Base):
class Country(Base): # type: ignore[valid-type,misc]
__tablename__ = "countries"

id = Column(Integer, primary_key=True)
name = Column(String, unique=True)


class FilmOffer(Base):
class FilmOffer(Base): # type: ignore[valid-type,misc]
__tablename__ = "film_offer_association_table"

film_id = mapped_column(ForeignKey("films.id"), primary_key=True)
Expand All @@ -45,7 +45,7 @@ class FilmOffer(Base):
url = Column(String, nullable=True)


class Offer(Base):
class Offer(Base): # type: ignore[valid-type,misc]
__tablename__ = "offers"

id = Column(Integer, primary_key=True)
Expand All @@ -60,7 +60,7 @@ class Offer(Base):
)


class Film(Base):
class Film(Base): # type: ignore[valid-type,misc]
__tablename__ = "films"

id = Column(Integer, primary_key=True)
Expand Down Expand Up @@ -97,7 +97,7 @@ def name(self):
return self.title


class Director(Base):
class Director(Base): # type: ignore[valid-type,misc]
__tablename__ = "directors"

id = Column(Integer, primary_key=True)
Expand Down

0 comments on commit 3a08b3f

Please sign in to comment.