Skip to content

Add format fix in git pre-commit hooks #105648

Closed
@chenyukang

Description

@chenyukang

I met this several times, I forget to run x fmt and push to remote, then get an format error and then rebase to fix it, it's trivial but it's a interruption.

If we add format fix in pre-commit, it won't happend again, it's a script like this one:
https://gist.github.com/folex/9496c457bcbbef36255a533389da740e

I tested in my local, seems works well.

Maybe we should add it to git hooks setup,
I'm not sure whether everyone like this behavior as default.

@jyn514

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions