feat: add unified linting scripts and git hooks for code quality enforcement

- Introduced `lint` and `lint-fix` applications in `flake.nix` for unified linting of backend (Python) and frontend (TypeScript/Svelte) code.
- Added `scripts/lint.sh` for manual linting execution.
- Created `scripts/install-hooks.sh` to set up git hooks for automatic linting before commits and optional tests before pushes.
- Updated `README.md` with instructions for using the new linting features and git hooks.
This commit is contained in:
Danilo Reyes
2025-11-02 00:08:37 -06:00
parent 4c94793aba
commit b55ac51fe2
32 changed files with 470 additions and 171 deletions

View File

@@ -1,6 +1,8 @@
"""Board model for reference boards."""
import uuid
from datetime import datetime
from sqlalchemy import Boolean, Column, DateTime, ForeignKey, String, Text
from sqlalchemy.dialects.postgresql import JSONB, UUID
from sqlalchemy.orm import relationship
@@ -17,11 +19,7 @@ class Board(Base):
user_id = Column(UUID(as_uuid=True), ForeignKey("users.id", ondelete="CASCADE"), nullable=False, index=True)
title = Column(String(255), nullable=False)
description = Column(Text, nullable=True)
viewport_state = Column(
JSONB,
nullable=False,
default={"x": 0, "y": 0, "zoom": 1.0, "rotation": 0}
)
viewport_state = Column(JSONB, nullable=False, default={"x": 0, "y": 0, "zoom": 1.0, "rotation": 0})
created_at = Column(DateTime, nullable=False, default=datetime.utcnow)
updated_at = Column(DateTime, nullable=False, default=datetime.utcnow, onupdate=datetime.utcnow)
is_deleted = Column(Boolean, nullable=False, default=False)
@@ -35,4 +33,3 @@ class Board(Base):
def __repr__(self) -> str:
return f"<Board(id={self.id}, title={self.title})>"