Skip to content

fix(repo): make a clean clone pass its own checks on Windows - #134

Open
kmuzammil101 wants to merge 2 commits into
trycompai:mainfrom
kmuzammil101:fix/hooks-path-double-redirect
Open

fix(repo): make a clean clone pass its own checks on Windows#134
kmuzammil101 wants to merge 2 commits into
trycompai:mainfrom
kmuzammil101:fix/hooks-path-double-redirect

Conversation

@kmuzammil101

@kmuzammil101 kmuzammil101 commented Aug 11, 2026

Copy link
Copy Markdown

I found two small Windows-related issues after cloning the project today and following the quick start:

bun install fails on Windows.
The prepare script uses two redirects (>/dev/null 2>&1), which Bun's shell can't parse on Windows. The dependencies still install, but the command exits with an error at the end. Because of this, core.hooksPath isn't configured, so the pre-push hook isn't installed. The CONTRIBUTING guide says bun install sets this up, but that's not true on Windows. I had to use --no-verify to push.

bun run lint fails because of Windows line endings.
Git for Windows uses CRLF by default, while Biome expects LF. Since the repo doesn't have a .gitattributes file, Windows checkouts get CRLF and linting fails across @crm/db, @crm/ui, and @crm/env. Adding * text=auto eol=lf to .gitattributes fixes this. git add --renormalize . produced no changes, so this shouldn't affect existing files or macOS users—it only makes Git use LF when checking out on Windows.

I also checked the tests. bun run test fails on an unmodified main as well, so it doesn't seem related to these changes. The bulk.spec.ts test times out after around 5 seconds and then the test process hangs.

Separately, bun run db:test also fails on a clean clone because pg is used in test-db.ts but isn't listed in any package.json. Also, test-db.ts expects TEST_DATABASE_URL from process.env, but when running through the packages/db filter, Bun doesn't load the root .env. The existing require-local-db.ts already handles this correctly.

Happy to send a separate fix for the database test issues.


Summary by cubic

Fix Windows setup: make the prepare script work with Bun’s shell and enforce LF checkouts so lint passes on Windows. After this, a clean clone on Windows installs Git hooks and bun run lint succeeds.

  • Bug Fixes
    • Update prepare to set core.hooksPath without double redirects (git config core.hooksPath .githooks 2>/dev/null || true) so bun install doesn’t error on Windows.
    • Add .gitattributes with * text=auto eol=lf to ensure LF line endings on Windows and avoid Biome CRLF lint failures.

Written for commit 6f200fd. Summary will update on new commits.

Review in cubic

@vercel

vercel Bot commented Aug 11, 2026

Copy link
Copy Markdown

@kmuzammil101 is attempting to deploy a commit to the Comp AI - PoC Team on Vercel.

A member of the Team first needs to authorize it.

@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 2 files

Re-trigger cubic

@ripgrim

ripgrim commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

@cubic-dev-ai verify this for me rq

@cubic-dev-ai

cubic-dev-ai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai verify this for me rq

@ripgrim Verified both changes—they're sound and match the PR's claims.

prepare script: Dropping git rev-parse --git-dir >/dev/null 2>&1 && in favor of a bare git config core.hooksPath .githooks 2>/dev/null || true is a reasonable fix for the Bun-shell redirect parsing issue. Keeping 2>/dev/null || true still silences the non-repo case and ensures a non-zero exit never fails the install, so hooks get configured on Windows. The only behavioral difference is that the git-dir existence guard is gone, so it would now also attempt the config outside a repo—harmless here given || true.

.gitattributes: * text=auto eol=lf is the right fix. text=auto lets Git keep detecting binaries, while eol=lf forces LF on checkout so Biome stops failing on CRLF. Since git add --renormalize . showed no diff, existing tracked content is unaffected, which matches your reasoning.

One thing I can't fully confirm from the snippet: the actual failure mode you hit with >/dev/null 2>&1 in Bun's shell on Windows. That's a plausible Bun-shell quirk, but if you want certainty it's worth confirming the CI/Windows repro before merging. The fix itself is low-risk regardless.

The separate bun run test / db:test issues you noted are outside this PR's scope, so leaving them for a follow-up is a reasonable call.

Tip: get faster answers by chatting with cubic’s review copilot in the review UI

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