From 341ee89f363c70c988ca4d0dde9f2e501c8d76a7 Mon Sep 17 00:00:00 2001 From: Gonzalo Diaz Date: Sat, 19 Sep 2026 21:14:57 -0300 Subject: [PATCH] [CONFIG] Makefile: JSON format/check re-arranged. [CONFIG] [Github Actions]: JSON format/check re-arranged. --- .github/workflows/prettier-json.yml | 18 ++++++++++-------- .prettierignore | 1 + Makefile | 13 +++++++++++-- 3 files changed, 22 insertions(+), 10 deletions(-) create mode 100644 .prettierignore diff --git a/.github/workflows/prettier-json.yml b/.github/workflows/prettier-json.yml index 7259a049..afa6d37b 100644 --- a/.github/workflows/prettier-json.yml +++ b/.github/workflows/prettier-json.yml @@ -3,28 +3,30 @@ name: Prettier JSON Lint on: # yamllint disable-line rule:truthy push: - branches: ['main'] + branches: ["main"] pull_request: - # The branches below must be a subset of the branches above - branches: ['main'] workflow_dispatch: jobs: json-lint: - name: 'Prettier JSON Lint' - runs-on: ['ubuntu-26.04'] + name: "Prettier JSON Lint" + runs-on: ["ubuntu-26.04"] steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 - name: Set up Node.js uses: actions/setup-node@v7 with: - node-version: 24.x + node-version: 26.x - name: Install Prettier run: | - npm install -g --ignore-scripts prettier@3.9.6 + npm install -g --ignore-scripts prettier@3.9.8 + + - name: Tool check + run: | + prettier --version - name: Prettier LINT / Style JSON run: > - prettier --check ./src/**/*.json + prettier --check ./**/*.json diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..6830205c --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +/*.json diff --git a/Makefile b/Makefile index 87a74d35..81a3a96f 100644 --- a/Makefile +++ b/Makefile @@ -119,7 +119,7 @@ lint: test/styling test/static lint/all: lint/markdown lint/yaml lint/json test/styling test/static format/json: - prettier --write ./src/**/*.json + prettier --write ./**/*.json format/sources: ${PACKAGE_TOOL} run autopep8 --in-place --recursive --aggressive --aggressive --verbose src/ @@ -193,6 +193,13 @@ compose/lint/yaml: yamllint --strict . \ && echo '✔ Your code looks good.' +compose/lint/json: + ${DOCKER_COMPOSE} --profile lint run --rm \ + --workdir /workspace \ + -v "$$(pwd):/workspace" \ + prettier --check /workspace/**/*.json \ + && echo '✔ Your code looks good.' + compose/test/styling: compose/build ${DOCKER_COMPOSE} --profile lint run --rm algorithm-exercises-py-lint make test/styling @@ -207,7 +214,9 @@ compose/test: compose/build compose/run: compose/build ${DOCKER_COMPOSE} --profile production run --rm algorithm-exercises-py make run -compose/all: compose/rebuild compose/test compose/lint +compose/lint: compose/test/styling compose/test/static + +compose/lint/all: compose/lint/markdown compose/lint/yaml compose/lint/json compose/test/styling compose/test/static all: $(call crono, make clean; make dependencies; make build; make test; make lint; make coverage/html)