Skip to content

ci: add prettier PR check and pre-commit formatting - #12

Merged
artiom merged 3 commits into
mainfrom
ci/prettier-standard
Jul 13, 2026
Merged

ci: add prettier PR check and pre-commit formatting#12
artiom merged 3 commits into
mainfrom
ci/prettier-standard

Conversation

@artiom

@artiom artiom commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Description

Standardizes Prettier enforcement:

  • New pr-prettier-check.yml workflow: on every PR, checks the files changed against the base branch using the exact Prettier version from package-lock.json. Installs only Prettier via npx instead of a full npm ci.
  • Pins prettier to an exact version. Prettier ships formatting changes in minor releases, so a version range can drift contributors against CI.
  • Pre-commit hook via husky + lint-staged formats staged files into the same commit. Where a post-commit prettier hook existed, it is removed: no more follow-up "chore: prettier" commits and no broken rebases.
  • One-time formatting cleanup where files had drifted, with generated/vendored paths added to .prettierignore.

Client-side hooks are advisory - contributors who install with scripts disabled never get hooks - which is why the CI check is the enforcement layer.

🤖 Generated with Claude Code


Open in Devin Review

Formatting was previously unenforced: the repo ships a prettier config
but nothing ran it. This wires up enforcement without changing the
config.

- add husky + lint-staged pre-commit: formats staged files into the
  same commit
- add a PR check that runs the exact prettier version from
  package-lock.json against PR-changed files only
- one-time cleanup of files that had drifted from the config
- ignore package-lock.json: npm owns its formatting, and this repo's
  tab-based prettier config would fight every npm install

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

- persist-credentials: false on checkout: nothing after it needs git
  credentials and npx executes downloaded code
- accept only exact-semver prettier versions from the PR-controlled
  lockfile before handing them to npx
- terminate prettier option parsing with -- so dash-prefixed filenames
  cannot be read as flags

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
n8n community-node lint forbids lifecycle scripts in the package
(no-forbidden-lifecycle-scripts): they execute arbitrary code when the
node installs into a user's n8n instance. Hooks become opt-in for
contributors via `npm run hooks:install`; the PR prettier check remains
the enforced gate.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@artiom
artiom merged commit 238ea1a into main Jul 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants