From f5f34426f66cb978ec0d88d0b7c0b16ea8f270e6 Mon Sep 17 00:00:00 2001 From: Jeremy Moore Date: Fri, 20 Sep 2024 14:57:31 -0400 Subject: [PATCH] run prettier via dev container --- Dockerfile.dev | 8 +++++++- Makefile | 4 ++-- package-lock.json | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Dockerfile.dev b/Dockerfile.dev index a5f21165..caa6a2f9 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -6,11 +6,17 @@ RUN apt-get update && \ apt-get install -y --no-install-recommends \ build-essential \ libffi-dev \ - libpq-dev + libpq-dev \ + npm RUN pip install poetry WORKDIR /app + +COPY package.json package-lock.json . + +RUN npm install + ENV PYTHONPATH=/app COPY pyproject.toml poetry.lock . diff --git a/Makefile b/Makefile index 7ef06c70..6fdcc7f6 100644 --- a/Makefile +++ b/Makefile @@ -28,13 +28,13 @@ lint: ## Lint the code poetry run ruff format --check && \ poetry run ruff check && \ poetry run mypy . - docker run --rm -v $(shell pwd):/work tmknom/prettier:3.2.5 --check ./*.md ./docs ./.github/workflows/* ./hushline + docker compose run --rm -v $(shell pwd):/work app npx prettier --check ./*.md ./docs ./.github/workflows/* ./hushline .PHONY: fix fix: ## Format the code poetry run ruff format && \ poetry run ruff check --fix - docker run --rm -v $(shell pwd):/work tmknom/prettier:3.2.5 --write ./*.md ./docs ./.github/workflows/* ./hushline + docker compose run --rm -v $(shell pwd):/work app npx prettier --write ./*.md ./docs ./.github/workflows/* ./hushline .PHONY: revision revision: migrate-prod ## Create a new migration diff --git a/package-lock.json b/package-lock.json index ac0ff9ee..087596f2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "hushline", + "name": "app", "lockfileVersion": 3, "requires": true, "packages": {