[P2 CI] Prettier gate excludes the application source, E2E tests, workflows, and scripts #135

Open
opened 2026-07-28 23:03:16 +00:00 by lost-rob0t · 0 comments
lost-rob0t commented 2026-07-28 23:03:16 +00:00 (Migrated from github.com)

Finding

The CI workflow runs npm run format:check, but the script checks only a narrow hard-coded list:

"format:check": "prettier --check .prettierrc.json package.json tsconfig.json eslint.config.js tests/unit tests/integration"

It excludes most of the repository, including:

  • src/** application code and tests;
  • e2e/**;
  • scripts/**, including PR #124 benchmark scripts;
  • .github/workflows/**;
  • Vite/Playwright configuration;
  • Markdown and other maintained text files.

The green CI check therefore does not mean the changed code is formatted. The same narrow path list is duplicated in the write command and will drift as directories are added.

Required fix

Use repository-wide Prettier discovery with an explicit ignore file.

{
  "scripts": {
    "format": "prettier --write .",
    "format:check": "prettier --check ."
  }
}

Add .prettierignore for generated/heavy artifacts only:

dist/
coverage/
playwright-report/
test-results/
benchmarks/results/
node_modules/
*.min.js

Do not ignore checked source fixtures or benchmark scripts merely because they are large.

For faster local checks, an optional changed-files command can coexist, but CI should retain a complete repository gate:

"format:changed": "prettier --write $(git diff --name-only --diff-filter=ACMR HEAD -- | tr '\n' ' ')"

Use a small Node script instead of shell substitution if cross-platform execution is required.

Acceptance criteria

  • npm run format:check checks all maintained source, tests, scripts, configs, workflows, and docs.
  • Generated output is excluded through .prettierignore.
  • npm run format and format:check cover the same file set.
  • CI fails on an intentionally misformatted file under src, e2e, and scripts.
  • PR #124 benchmark files are covered by the formatting gate.
## Finding The CI workflow runs `npm run format:check`, but the script checks only a narrow hard-coded list: ```json "format:check": "prettier --check .prettierrc.json package.json tsconfig.json eslint.config.js tests/unit tests/integration" ``` It excludes most of the repository, including: - `src/**` application code and tests; - `e2e/**`; - `scripts/**`, including PR #124 benchmark scripts; - `.github/workflows/**`; - Vite/Playwright configuration; - Markdown and other maintained text files. The green CI check therefore does not mean the changed code is formatted. The same narrow path list is duplicated in the write command and will drift as directories are added. ## Required fix Use repository-wide Prettier discovery with an explicit ignore file. ```json { "scripts": { "format": "prettier --write .", "format:check": "prettier --check ." } } ``` Add `.prettierignore` for generated/heavy artifacts only: ```gitignore dist/ coverage/ playwright-report/ test-results/ benchmarks/results/ node_modules/ *.min.js ``` Do not ignore checked source fixtures or benchmark scripts merely because they are large. For faster local checks, an optional changed-files command can coexist, but CI should retain a complete repository gate: ```json "format:changed": "prettier --write $(git diff --name-only --diff-filter=ACMR HEAD -- | tr '\n' ' ')" ``` Use a small Node script instead of shell substitution if cross-platform execution is required. ## Acceptance criteria - `npm run format:check` checks all maintained source, tests, scripts, configs, workflows, and docs. - Generated output is excluded through `.prettierignore`. - `npm run format` and `format:check` cover the same file set. - CI fails on an intentionally misformatted file under `src`, `e2e`, and `scripts`. - PR #124 benchmark files are covered by the formatting gate.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nsaspy/quasar-ui#135
No description provided.