Skip to content

Conversation

@ryoppippi
Copy link
Member

@ryoppippi ryoppippi commented Jan 13, 2026

Summary

Migrates lefthook from pnpm devDependencies to nix flake for consistent tooling across the team.

What Changed

  • Added lefthook to flake.nix buildInputs
  • Added lefthook install to shellHook for automatic git hooks setup on devshell entry
  • Removed lefthook from package.json devDependencies
  • Removed lefthook from pnpm-workspace.yaml catalog and onlyBuiltDependencies

Summary by cubic

Migrated Lefthook from pnpm to the Nix flake for consistent versions and simpler setup. Git hooks now auto-install when entering the devshell.

  • Refactors

    • Added lefthook to flake.nix buildInputs and shellHook runs lefthook install.
    • Removed lefthook from package.json and pnpm-workspace.yaml (catalog, onlyBuiltDependencies).
    • Removed lefthook binaries and entries from pnpm-lock.yaml.
  • Migration

    • Use nix develop to get hooks installed; pnpm no longer manages lefthook.
    • If hooks aren’t present, re-enter the devshell or run lefthook install.

Written for commit bd7d7f0. Summary will update on new commits.

Move lefthook from pnpm devDependencies to nix flake buildInputs.
This ensures consistent versioning across the team via nix and
automatically installs git hooks when entering the devshell.

Changes:
- Add lefthook to flake.nix buildInputs
- Add `lefthook install` to shellHook for automatic setup
- Remove lefthook from package.json devDependencies
- Remove lefthook from pnpm-workspace.yaml catalog and onlyBuiltDependencies
Copilot AI review requested due to automatic review settings January 13, 2026 13:13
@ryoppippi ryoppippi requested a review from a team as a code owner January 13, 2026 13:13
@ryoppippi ryoppippi merged commit 4afbb83 into main Jan 13, 2026
21 checks passed
@ryoppippi ryoppippi deleted the chore/migrate-lefthook-to-nix branch January 13, 2026 13:13
Copy link
Contributor

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

Choose a reason for hiding this comment

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

1 issue found across 4 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="flake.nix">

<violation number="1" location="flake.nix:55">
P2: `lefthook install` redirects stderr to `/dev/null`, so hook-install failures are silent and the devshell keeps running without required hooks. Let stderr surface (or explicitly handle failures) so developers notice problems.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

fi
# Install lefthook git hooks
lefthook install > /dev/null 2>&1
Copy link
Contributor

Choose a reason for hiding this comment

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

P2: lefthook install redirects stderr to /dev/null, so hook-install failures are silent and the devshell keeps running without required hooks. Let stderr surface (or explicitly handle failures) so developers notice problems.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At flake.nix, line 55:

<comment>`lefthook install` redirects stderr to `/dev/null`, so hook-install failures are silent and the devshell keeps running without required hooks. Let stderr surface (or explicitly handle failures) so developers notice problems.</comment>

<file context>
@@ -47,6 +50,9 @@
               fi
+
+              # Install lefthook git hooks
+              lefthook install > /dev/null 2>&1
             '';
           };
</file context>
Suggested change
lefthook install > /dev/null 2>&1
lefthook install > /dev/null

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR migrates the lefthook git hooks manager from being an npm package (managed via pnpm) to being provided through the Nix flake development environment. This change ensures consistent tooling across the development team by leveraging Nix's reproducible environment management.

Changes:

  • Removed lefthook from pnpm dependencies (package.json, pnpm-workspace.yaml, and pnpm-lock.yaml)
  • Added lefthook to Nix flake buildInputs and configured automatic git hooks installation via shellHook
  • All lefthook platform-specific binaries removed from lockfile (darwin, linux, windows, freebsd, openbsd variants)

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
flake.nix Added lefthook to buildInputs and added automatic installation in shellHook
package.json Removed lefthook from devDependencies catalog reference
pnpm-workspace.yaml Removed lefthook from dev catalog and onlyBuiltDependencies list
pnpm-lock.yaml Removed all lefthook package entries including platform-specific binaries
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +54 to +55
# Install lefthook git hooks
lefthook install > /dev/null 2>&1
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

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

The error suppression for the lefthook install command may hide important installation failures. If lefthook fails to install git hooks (e.g., due to permissions issues or missing configuration), developers won't be notified. Consider either:

  1. Allowing errors to display so developers can see if something goes wrong
  2. Adding a conditional check to verify the installation succeeded
  3. At minimum, only suppressing stdout while keeping stderr visible: lefthook install > /dev/null
Suggested change
# Install lefthook git hooks
lefthook install > /dev/null 2>&1
# Install lefthook git hooks (suppress stdout but keep stderr visible)
lefthook install > /dev/null

Copilot uses AI. Check for mistakes.
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