Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/prettier-json.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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: >
Expand Down
24 changes: 21 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 \
Expand All @@ -184,15 +199,18 @@ 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

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
7 changes: 7 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down