From 769290528d240a92947d158493de807feac19b55 Mon Sep 17 00:00:00 2001 From: Anson Date: Sun, 15 Oct 2023 22:58:15 +0000 Subject: [PATCH] add prettier --- .devcontainer/devcontainer.json | 5 +++-- .gitlab-ci.yml | 8 +++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 0e4ea09..4c0bbd8 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -5,7 +5,8 @@ // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile // "image": "mcr.microsoft.com/devcontainers/python:1-3-bookworm", "build": { - "dockerfile": "Dockerfile" + "dockerfile": "Dockerfile", + "context": ".." }, "features": { "ghcr.io/devcontainers-contrib/features/black:2": {}, @@ -26,7 +27,7 @@ ] } }, - "postCreateCommand": "pip3 install --user -r dev-reqs.txt" + "postCreateCommand": "pip3 install --user -r dev-reqs.txt && apt-get update && apt-get install -y nodejs npm && npm install" // Features to add to the dev container. More info: https://containers.dev/features. // "features": {}, // Use 'forwardPorts' to make a list of ports inside the container available locally. diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ecaf7e2..84de42f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,11 +13,17 @@ black: ruff: stage: lint - # image: registry.gitlab.com/pipeline-components/ruff:latest image: python:3.11-slim script: - pip3 install ruff - ruff --output-format gitlab . +prettier: + stage: lint + image: node:16-slim # Use Node.js image since prettier is a Node.js tool + script: + - npm install prettier + - npx prettier --check . # Adjust the path as needed + include: - local: /site/.gitlab-ci.yml