Skip to content

feat(git): biome pre-commit hook - #1487

Open
Dhruv-0-Arora wants to merge 5 commits into
devfrom
darora1/336/biome-commit-hook
Open

feat(git): biome pre-commit hook#1487
Dhruv-0-Arora wants to merge 5 commits into
devfrom
darora1/336/biome-commit-hook

Conversation

@Dhruv-0-Arora

@Dhruv-0-Arora Dhruv-0-Arora commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Task

A git hook to notify you when you try to commit something that you have a formatting error in the files that you are trying to commit. To install just bun i

  • will append a sh /fission/scripts/hooks/pre-commit to your /.git/hooks/pre-commit

To bypass, run git commit *--no-verify* when committing

Note

Works on git worktrees only if that worktree contains the /fission/scripts/hooks/pre-commit file

Warning

Install script doesn't work on windows when using powershell and cmd. Fails cleanly

SYNTH-336

Symptom

There a quite a few chore(formatting): ... commits right now. This PR aims to reduce the number of those.

Verification

Create a formatting mistake in a file and try to commit the formatting mistake.


Before merging, ensure the following criteria are met:

  • All acceptance criteria outlined in the ticket are met.
  • Necessary test cases have been added and updated.
  • A feature toggle or safe disable path has been added (if applicable).
  • User-facing polish:
    • Ask: "Is this ready-looking?"
  • Cross-linking between Jira and GitHub:
    • PR links to the relevant Jira issue.
    • Jira ticket has a comment referencing this PR.

blocks the commit when it finds biome issues with the changed code
Comment thread fission/package.json Outdated
Signed-off-by: Dhruv Arora <dhruv.arora1@autodesk.com>
Comment thread fission/package.json Outdated
@Dhruv-0-Arora
Dhruv-0-Arora requested a review from 0xda157 August 10, 2026 18:36
Comment thread fission/package.json Outdated
Comment thread fission/README.md Outdated
@Dhruv-0-Arora
Dhruv-0-Arora force-pushed the darora1/336/biome-commit-hook branch from b88ee6c to a93ecdd Compare August 12, 2026 18:55
@Dhruv-0-Arora
Dhruv-0-Arora requested a review from rutmanz August 12, 2026 18:55
Signed-off-by: Dhruv Arora <dhruv.arora1@autodesk.com>
@Dhruv-0-Arora
Dhruv-0-Arora force-pushed the darora1/336/biome-commit-hook branch from a93ecdd to 5b4b95b Compare August 12, 2026 21:19
Comment thread fission/package.json
"assetpack:update": "bun update_manifest.ts && cd public && zip -FS -r assetpack.zip Downloadables -x '**/.*' -x '**/__MACOSX'",
"assetpack:merge": "git checkout --theirs public/assetpack.zip && rm -rf public/Downloadables && tar -xf public/assetpack.zip -C public/ && git checkout --ours public/assetpack.zip && tar -xf public/assetpack.zip -C public/ && bun run assetpack:update",
"playwright:install": "bun x playwright install",
"prepare": "f=$(git rev-parse --git-path hooks/pre-commit 2>/dev/null) || exit 0; [ -e \"$f\" ] || printf '#!/bin/sh\\n' > \"$f\"; grep -q fission/scripts/hooks/pre-commit \"$f\" || printf 'sh ./fission/scripts/hooks/pre-commit\\n' >> \"$f\"; chmod +x \"$f\"",

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.

??? this is a terrible one liner. make this it's own script or simplify it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I would personally disagree - I feel that a script is unnecessary and all this line does is append
sh ./fission/scripts/hooks/pre-commit to .git/hooks/pre-commit if it doesn't already exist.

@rutmanz rutmanz Aug 14, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If you're using bash if statements it should probably be an actual file imo. Having everything on one line with a bunch of string escaping and no whitespace is not exactly a nice experience

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

👍 im going to change it. Julian also agreed with you guys

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.

3 participants