Skip to content

Lint staged files on commit and skip e2e on docs-only PRs - #82

Open
ccruzkauppila wants to merge 2 commits into
ilmo-hackathon-consolidationfrom
claude/project-thread-1ywtz6
Open

ccruzkauppila wants to merge 2 commits into
ilmo-hackathon-consolidationfrom
claude/project-thread-1ywtz6

Conversation

@ccruzkauppila

@ccruzkauppila ccruzkauppila commented Oct 19, 2026 •

Copy link
Copy Markdown

Requested by Charlie · project thread

Before: nothing checked files before a commit, so formatting and lint problems only surfaced when CI failed. Every PR also ran the full Cypress e2e suite, even PRs that only changed Markdown.

After: git commit runs eslint --fix and prettier --write on the staged files only. PRs that only touch **/*.md or docs/** skip e2e, and "All checks passed" still goes green for them.

How:

  • Adds husky and lint-staged, with "prepare": "husky || true" so that pnpm install installs the hook. The || true keeps installs working where husky isn't present: the Docker build's pnpm prune --prod runs prepare after dev dependencies are removed. Husky's docs suggest this.
  • Adds a Detect changes job (dorny/paths-filter@v4) that only runs on pull requests. Pushes to main and manual runs always run e2e, so deploys stay fully gated.
  • all-checks now requires changes and ci to pass. It accepts a skipped e2e only when the PR is docs-only.
  • Type checking and tests stay out of the hook and keep running in full in CI.
  • Adds a short CONTRIBUTING.md section about the hook and --no-verify.

On a commit with 2 changed files, the hook takes about 6 seconds.

🤖 Generated with Claude Code

https://claude.ai/code/session_019vExrP5TeAmorht8FsXsZh

Add husky and lint-staged so a pre-commit hook runs eslint --fix and
prettier --write on staged files. Add a paths-filter job to the pipeline
so pull requests that only touch Markdown or docs/ skip the e2e suite;
the all-checks gate accepts a skipped e2e only in that case.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019vExrP5TeAmorht8FsXsZh
@ccruzkauppila ccruzkauppila self-assigned this Oct 19, 2026
@github-actions

Copy link
Copy Markdown

📦 Next.js Bundle Analysis for @app/client

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

pnpm prune --prod in the Docker build runs the prepare script after dev
dependencies are removed, so husky isn't on the PATH there.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019vExrP5TeAmorht8FsXsZh
@github-actions

Copy link
Copy Markdown

📦 Next.js Bundle Analysis for @app/client

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

@ccruzkauppila
ccruzkauppila marked this pull request as ready for review October 19, 2026 18:28
@ccruzkauppila
ccruzkauppila changed the base branch from main to ilmo-hackathon-consolidation November 20, 2026 14:48
ccruzkauppila added a commit that referenced this pull request Nov 20, 2026

This branch has not been deployed

No deployments
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