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
18 changes: 10 additions & 8 deletions .github/workflows/prettier-json.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/*.json
13 changes: 11 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down Expand Up @@ -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

Expand All @@ -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)
Expand Down
Loading