phase 3.2 & 4.1
This commit is contained in:
32
flake.nix
32
flake.nix
@@ -103,14 +103,18 @@
|
||||
type = "app";
|
||||
program = "${pkgs.writeShellScript "lint" ''
|
||||
set -e
|
||||
cd ${self}
|
||||
|
||||
# Backend Python linting
|
||||
echo "🔍 Linting backend Python code..."
|
||||
cd backend
|
||||
${pkgs.ruff}/bin/ruff check --no-cache app/
|
||||
${pkgs.ruff}/bin/ruff format --check app/
|
||||
cd ..
|
||||
if [ -d "backend" ]; then
|
||||
cd backend
|
||||
${pkgs.ruff}/bin/ruff check --no-cache app/
|
||||
${pkgs.ruff}/bin/ruff format --check app/
|
||||
cd ..
|
||||
else
|
||||
echo "⚠ Not in project root (backend/ not found)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Frontend linting (if node_modules exists)
|
||||
if [ -d "frontend/node_modules" ]; then
|
||||
@@ -118,7 +122,7 @@
|
||||
echo "🔍 Linting frontend TypeScript/Svelte code..."
|
||||
cd frontend
|
||||
npm run lint
|
||||
npx prettier --check src/
|
||||
${pkgs.nodePackages.prettier}/bin/prettier --check src/
|
||||
npm run check
|
||||
cd ..
|
||||
else
|
||||
@@ -135,19 +139,23 @@
|
||||
type = "app";
|
||||
program = "${pkgs.writeShellScript "lint-fix" ''
|
||||
set -e
|
||||
cd ${self}
|
||||
|
||||
echo "🔧 Auto-fixing backend Python code..."
|
||||
cd backend
|
||||
${pkgs.ruff}/bin/ruff check --fix --no-cache app/
|
||||
${pkgs.ruff}/bin/ruff format app/
|
||||
cd ..
|
||||
if [ -d "backend" ]; then
|
||||
cd backend
|
||||
${pkgs.ruff}/bin/ruff check --fix --no-cache app/ || true
|
||||
${pkgs.ruff}/bin/ruff format app/
|
||||
cd ..
|
||||
else
|
||||
echo "⚠ Not in project root (backend/ not found)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -d "frontend/node_modules" ]; then
|
||||
echo ""
|
||||
echo "🔧 Auto-fixing frontend code..."
|
||||
cd frontend
|
||||
npx prettier --write src/
|
||||
${pkgs.nodePackages.prettier}/bin/prettier --write src/
|
||||
cd ..
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user