From 3a8fdbb8ad7f5764440c8694dec27faf09b9eb81 Mon Sep 17 00:00:00 2001 From: Bryan English Date: Mon, 26 Oct 2026 13:55:04 -0400 Subject: [PATCH] ci: add a prettier check Prettier becomes a devDependency with a lockfile, so the check is reproducible: npm ci installs the pinned version and npm run format:check enforces it. Markdown stays outside Prettier's scope through .prettierignore, since its prose and table reflow churns docs without improving consistency. The check runs on the same triggers as the test and benchmark jobs. Signed-off-by: Bryan English --- .github/workflows/ci.yml | 10 ++++++++++ .gitignore | 1 + .prettierignore | 1 + package-lock.json | 35 +++++++++++++++++++++++++++++++++++ package.json | 6 +++++- 5 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 .prettierignore create mode 100644 package-lock.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 482af0b..554d479 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,3 +32,13 @@ jobs: with: node-version: latest - run: npm run bench + + prettier: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-node@v7 + with: + node-version: latest + - run: npm ci + - run: npm run format:check diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c2658d7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules/ diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..dd44972 --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +*.md diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..fa26e29 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,35 @@ +{ + "name": "@nodejs/microtel", + "version": "0.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@nodejs/microtel", + "version": "0.0.0", + "license": "MIT", + "devDependencies": { + "prettier": "3.9.10" + }, + "engines": { + "node": ">=26.9.0" + } + }, + "node_modules/prettier": { + "version": "3.9.10", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.9.10.tgz", + "integrity": "sha512-skGHTH1Yb9QvaTC4hWnRTzEYtCpApF0UMBPz+t/0ZPzP8ihefo/btKd+QA7pUE0fEwA1SbS/NmhyEcstdXOIdA==", + "dev": true, + "license": "MIT", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + } + } +} diff --git a/package.json b/package.json index 53dc02c..d15c0c0 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,10 @@ }, "scripts": { "test": "node --test 'test/test-*.js'", - "bench": "node --experimental-bench --bench 'benchmark/*.bench.js'" + "bench": "node --experimental-bench --bench 'benchmark/*.bench.js'", + "format:check": "prettier --check ." + }, + "devDependencies": { + "prettier": "3.9.10" } }