diff --git a/.github/workflows/prettier-json.yml b/.github/workflows/prettier-json.yml index fb928cfb..7259a049 100644 --- a/.github/workflows/prettier-json.yml +++ b/.github/workflows/prettier-json.yml @@ -12,7 +12,7 @@ on: # yamllint disable-line rule:truthy jobs: json-lint: name: 'Prettier JSON Lint' - runs-on: ['ubuntu-24.04'] + runs-on: ['ubuntu-26.04'] steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 @@ -23,7 +23,7 @@ jobs: - name: Install Prettier run: | - npm install -g --ignore-scripts prettier@3.7.4 + npm install -g --ignore-scripts prettier@3.9.6 - name: Prettier LINT / Style JSON run: > diff --git a/Makefile b/Makefile index e869538e..87a74d35 100644 --- a/Makefile +++ b/Makefile @@ -26,6 +26,14 @@ BRUTEFORCE :=$(shell echo '${BRUTEFORCE}'| tr '[:lower:]' '[:upper:]'| tr -d '[: .PHONY: all clean dependencies help list test .EXPORT_ALL_VARIABLES: # (2) +define crono + @start=$$(date +%s); \ + $(1); \ + end=$$(date +%s); \ + diff=$$((end - start)); \ + printf "Total time: %02d:%02d:%02d\n" $$((diff/3600)) $$((diff%3600/60)) $$((diff%60)) +endef + RUNTIME_TOOL=python3 PACKAGE_TOOL=pipenv @@ -108,7 +116,7 @@ lint/yaml: lint: test/styling test/static -lint/all: lint/markdown lint/yaml test/styling test/static +lint/all: lint/markdown lint/yaml lint/json test/styling test/static format/json: prettier --write ./src/**/*.json @@ -164,6 +172,13 @@ compose/rebuild: env ${DOCKER_COMPOSE} --profile testing build --no-cache ${DOCKER_COMPOSE} --profile production build --no-cache +compose/lint/json: + ${DOCKER_COMPOSE} --profile lint run --rm \ + --workdir /workspace \ + -v "$$(pwd):/workspace" \ + prettier --check '/workspace/**/*.json' \ + && echo '✔ Your code looks good.' + compose/lint/markdown: ${DOCKER_COMPOSE} --profile lint run --rm \ --workdir /workspace \ @@ -184,7 +199,7 @@ compose/test/styling: compose/build compose/test/static: compose/build ${DOCKER_COMPOSE} --profile lint run --rm algorithm-exercises-py-lint make test/static -compose/lint: compose/lint/markdown compose/lint/yaml compose/test/styling compose/test/static +compose/lint: compose/lint/json compose/lint/markdown compose/lint/yaml compose/test/styling compose/test/static compose/test: compose/build ${DOCKER_COMPOSE} --profile testing run --rm algorithm-exercises-py-test make test @@ -192,7 +207,10 @@ compose/test: compose/build compose/run: compose/build ${DOCKER_COMPOSE} --profile production run --rm algorithm-exercises-py make run -all: lint coverage +compose/all: compose/rebuild compose/test compose/lint + +all: + $(call crono, make clean; make dependencies; make build; make test; make lint; make coverage/html) run: ls -alh diff --git a/compose.yaml b/compose.yaml index 3c1c6e4d..edcf7617 100644 --- a/compose.yaml +++ b/compose.yaml @@ -25,6 +25,13 @@ services: - ./:/app profiles: ["lint"] + prettier: + image: goncl/prettier:latest + working_dir: /workspace + volumes: + - ./:/workspace + profiles: ["lint"] + markdownlint: image: goncl/markdownlint-cli:latest working_dir: /workspace