Skip to content

fix(hooks): skip local lint and type-check when the working tree differs from the pushed commit - #10302

Merged
waleedlatif1 merged 2 commits into
stagingfrom
fix/pre-push-clean-tree
Nov 22, 2026
Merged

waleedlatif1 merged 2 commits into
stagingfrom
fix/pre-push-clean-tree

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • The pre-push hook's biome and type-check steps read the working tree, but its comment claimed the tree held HEAD. With uncommitted edits or untracked TypeScript, they judged a different tree from the one being pushed. They could block a sound commit (a half-written untracked file breaks the type-check) or pass a broken one (the commit imports a file that is still untracked)
  • The hook now runs lint and type-check only when no tracked file differs from HEAD (staged or not) and there is no untracked file the type-check can read: TypeScript, JavaScript (allowJs) or JSON (resolveJsonModule). Otherwise it leaves them to CI, which runs the full gate on every PR. The gate sits above the origin/staging-missing fallback, so both paths honor it
  • Untracked files of other kinds (scratch notes, logs) no longer matter to lint or type-check, so keeping them around doesn't switch local checks off
  • The generated-artifact check keeps its own stricter gate (any untracked file), since generators can read untracked docs pages
  • Raised in review on the release PR (v0.9.65: workflows as code, pierre editor, redis required #10299)

Type of Change

  • Bug fix

Testing

  • shellcheck
  • Gate per tree state: clean → run; untracked .txt → run; untracked .ts/.mjs/.json → skip; unstaged edit → skip; staged edit → skip
  • Pushes of a non-HEAD ref and of a dirty tree exit 0 with their notices; this branch's own push ran the full hook on a clean tree

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Ignored Ignored Preview Nov 22, 2026 12:08am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge.

Summary

The hook now skips local checks when untracked JavaScript or JSON files could make them judge a different tree from the pushed commit.

  • The pre-push hook skips lint and type-check when tracked edits or untracked source files exist.

Reviews (2) · Last reviewed commit: "fix(hooks): treat untracked JavaScript a..." · Reviewed by Greptile

Comment thread .husky/pre-push Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 92aee6b into staging Nov 22, 2026
79 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.

1 participant